Removing Auto-Generated Hreflangs While Keeping the Language Switcher

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!

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

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. 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