[Resolved] hreflang Code Failing with WPML and Elementor Pro
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is trying to implement hreflang tags on a multilingual WordPress site using WPML and Elementor Pro. Despite manually adding hreflang code 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, but the hreflang Validator Tool shows errors for missing self-referential hreflang tags for languages other than English. Solution: We recommend the following steps to ensure proper hreflang tag implementation: 1. Create a backup of your website, or better yet, test this on a staging version of the site. 2. Navigate to
WordPress Dashboard > Plugins > Add new > Commercial (tab)
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at https://wpml.org/forums/forum/english-support/.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
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.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.