I am using two languages on my website, and the hreflang tags are generated through the {{ content_for_header }} hook. However, I am experiencing an issue where the hreflang tags are incorrect on the tagged pages. I have attached a screenshot for further clarification. I would appreciate any assistance in resolving this issue, as it appears to be a problem with Shopify.
Hey @salamseo
If you’re experiencing incorrect hreflang tags on the tagged pages, you can try the following troubleshooting steps:
-
Verify that the language settings in your Shopify admin are correctly configured. Ensure that each language is properly set up, including language codes and locales.
-
Double-check the implementation of the hreflang tags in your theme’s code. The tags should be generated dynamically based on the language settings of your store. Ensure that the tags are correctly placed within the section of the HTML code and that the language codes match the languages used on the corresponding pages.
-
Check if any third-party apps or customizations might be conflicting with the hreflang tags. Temporarily disable any language-related apps or custom code and test if the issue persists. If the incorrect hreflang tags disappear after disabling certain elements, you can narrow down the cause and reach out to the app developer or review the custom code for potential conflicts.
-
If the issue persists, you may need to reach out to Shopify Support or consult with a Shopify Expert. They will have access to more detailed information about your specific store setup and can assist you in diagnosing and resolving the hreflang tag issue.
When contacting Shopify Support or a Shopify Expert, provide them with specific details about the incorrect hreflang tags, including the affected pages, the expected language codes, and any relevant theme or app customizations you have implemented.
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Currently, there is no app or third-party code causing any conflicts. Additionally, there is no code present in the head section. The hreflang tags are being generated from the {{ content_for_header }} hook, which is correctly placed in the head section.
