Background of the issue:
I am trying to implement hreflang tags on my multilingual WordPress site using WPML and Elementor Pro. Despite adding the hreflang code manually to the English page header via Elementor Pro, the setup fails to reflect on translated pages. The WPML configuration is set to update hreflang automatically with the option set to immediate. Here is the code I added: <link rel="alternate" hreflang="en" href="hidden link" /> <link rel="alternate" hreflang="it" href="hidden link" /> <link rel="alternate" hreflang="de" href="hidden link" /> <link rel="alternate" hreflang="fr" href="hidden link" /> <link rel="alternate" hreflang="x-default" href="hidden link" />.
Symptoms:
On the Italian page (hidden link), no hreflang tags appear. The hreflang Validator Tool shows errors for missing self-referential hreflang tags for languages other than English. Manual edits to the Elementor Pro header do not reflect on translated pages. WPML fails to propagate hreflang code to translated headers.
Questions:
Why are hreflang tags not appearing on translated pages?
How can I ensure WPML propagates hreflang tags to all language headers?
Why does the hreflang Validator Tool show errors for missing self-referential hreflang tags?
What steps can I take to resolve conflicts between WPML and Elementor Pro regarding hreflang implementation?
Welcome to WPML support. The manual addition of HREFLANG code is not supported in WPML as WPML handles that automatically and generates the proper code.
Please do as follows:
- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Go to "WordPress Dashboard > Plugins > Add new > Commercial (tab)".
- Click the "Check for Updates" button.
- Update WPML and its addons there.
- Make sure that you install the WPML SEO plugin from there too as it is necessary for correct hreflang generation.
Hello
As requested the plugin is updated and the SEO plugin installed
i have forced the language code and save the settings
The header seemed to be translated but I do not see the Hreflang Code on IT DE FR LU languages, the option
set Display alternative languages in the HEAD section. to as early possible action
It is still reporting errors
Is there a setting that needs to be set to force the automation hreflang to setup
tx
rgds
In the video, I reviewed the website’s WPML-generated code and confirmed that everything is set up correctly. The English version is designated as the default language, while the Italian version is properly configured with the correct hflang attributes. Although some validation tools might raise concerns, this behavior is standard HTML code, and the final interpretation of the code lies with Google. Overall, the WPML setup is functioning as expected.