# Removing Auto-Generated Hreflangs While Keeping the Language Switcher

**URL:** <https://community.hubspot.com/t/removing-auto-generated-hreflangs-while-keeping-the-language-switcher/136484>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [July 18, 2025, 1:22pm UTC](https://community.hubspot.com/t/removing-auto-generated-hreflangs-while-keeping-the-language-switcher/136484 "2025-07-18T13:22:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TSygut4](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@TSygut4](https://community.hubspot.com/u/TSygut4)\
**Post date:** [July 18, 2025, 1:22pm UTC](https://community.hubspot.com/t/removing-auto-generated-hreflangs-while-keeping-the-language-switcher/136484/1 "2025-07-18T13:22:13Z")

</div>

Hi!  
Is there any way to remove auto-generated Hreflangs while keeping the language switcher functionality?  
I have a request from the client to keep pages in the German language, but change hreflang from de to de-DE. It’s not possible to change it automatically on all 2000 pages, so it will be hard to do it manually.  
Any ideas?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Victor\_Becerra](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@Victor\_Becerra](https://community.hubspot.com/u/Victor_Becerra)\
**Post date:** [July 18, 2025, 8:00pm UTC](https://community.hubspot.com/t/removing-auto-generated-hreflangs-while-keeping-the-language-switcher/136484/2 "2025-07-18T20:00:58Z")

</div>

Hi @TSygut4  
Thank you for reaching out to the Community!  
I’d like to invite some community members who are subject matter experts to join this conversation.  
@Indra @JVermunt @GRajput - Would you be able to share any insights on this? Your expertise would be greatly appreciated.  
Best,

Victor

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [July 18, 2025, 10:29pm UTC](https://community.hubspot.com/t/removing-auto-generated-hreflangs-while-keeping-the-language-switcher/136484/3 "2025-07-18T22:29:41Z")

</div>

Hey @TSygut4,

I could think of at least 2 options.

1. Use the Pages API to fetch all pages, modify the header with search&replace and push them back.
2. Modify the {{standard\_header\_includes}} in the base.html with a few filters like the [replace filter](https://developers.hubspot.de/docs/reference/cms/hubl/filters#replace). Not the best solution in this case, but possible.

A replace filter could look something like this:

`{{ standard_header_includes|replace('content="de"','content="de-de"') }}`

best,

Anton
