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!
Hey @TSygut4,
I could think of at least 2 options.
- Use the Pages API to fetch all pages, modify the header with search&replace and push them back.
- 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