How to remove hreflang multilingual tag - only keep en and nl

hasansumon
Visitor
1 0 1
Hi, I'm seeking some expert advice on a Shopify-related issue. I'm encountering alternate hreflang tags.
I want to keep x-default, nl-nl, and nl-en and delete all hreflang tag but I couldn't find it on theme editor (theme.liquid file).
How can I fix this issue? Thanks in advance for your help!
 
423224435_7891055244239124_5381643663096213893_n.jpg
Reply 1 (1)

michaelivanov
Shopify Partner
33 4 9

Not sure if this is the best way to do this but you could do it with a simple replace like this:

 

Replace 

 

{{ content_for_header }}

 

inside your theme.liquid with (this is an example with hreflang tags from a different store):

 

    {% comment %}{{ content_for_header }}{% endcomment %}
    {{ content_for_header | replace: '<link rel="alternate" hreflang="en-DE" href="https://vibrantriver.myshopify.com/">
<link rel="alternate" hreflang="de-DE" href="https://vibrantriver.myshopify.com/de">
<link rel="alternate" hreflang="fr-DE" href="https://vibrantriver.myshopify.com/fr">', ''}}

 

Before:

michael_langify_0-1712786404939.png

 

After:

michael_langify_1-1712786492418.png

 

 

Langify FAQ
https://faq.langify-app.com/