We have identified an issue with our website’s SEO where Google is indexing duplicated pages. Our website currently has three markets set up in Shopify: United States, Canada, and International (for all other countries).
We discovered that this issue is caused by Shopify automatically adding hreflang tags for every country in the International market, which directs to a “/en-international” subfolder that contains the same content as other pages.
To solve it, we are planning to delete all the hreflang tags except for the US and Canada, since these are the main markets we sell to, while still keeping the “/en-international” subfolder configuration. Could anyone please advise us on the best approach to do this? We appreciate your help. Thanks a lot!
-
Look for the file that corresponds to the header or head section of your website (e.g., header.liquid, theme.liquid, or head.liquid).
-
Open the file and search for the code that generates the hreflang tags. It typically looks like this:
-
Identify the section of the code that generates hreflang tags for the International market (“/en-international”) and remove it. Make sure to keep the hreflang tags for the United States and Canada intact.
-
Save the changes to the file.
-
Clear your website’s cache to ensure the changes take effect.
I hope this helps and I’m curious to know what you think about these app suggestions. Feel free to respond here and let me know!
Hi @juanpfc ,
Removing unwanted hreflang tags can indeed help prevent Google from indexing duplicate content across your international markets. One approach is to manually adjust the Liquid template that generates the hreflang tags in your Shopify theme. Specifically, you would:
- Go to the theme editor.
- Locate the section where hreflang tags are generated, typically in a file like theme.liquid or header.liquid.
- Adjust the code to exclude the hreflang tags for the international market. You might need to add conditional statements that only include the US and Canada markets.
- Ensure to test changes on a duplicated theme before going live to prevent any disruptions.
If you’re not comfortable with coding, SEOPro could assist in managing various SEO aspects of your Shopify store, including providing recommendations for optimizing SEO Meta Title, Meta Description, and content for different market locales, which could indirectly help with such issues. Plus, it offers bulk optimization tools for various SEO elements.
Full disclosure: We are the developer of this app.