Background of the issue:
I am trying to translate articles from EN to ES on our website blog. The issue can be seen on this page: hidden link. I expected to see:
Thank you for contacting the support. Meanwhile this ticket is attended by one of my colleagues, can you please add a WPML Language Switcher to the site and see what URLs it provides for the default language and the translated ones? Please also compare these URLs by opening the translation of the page.
I see that you're using a link for the alternate language version, which is probably having a hand-crafted link. While, the hreflangs are produced based on the languages added in the site and WPML Language Switcher follows it to provide correct references.
If language switcher matches the produced hreflangs in site source code, then probably the issue is somewhere else.
Besides this, I'll also recommend upgrading WordPress to the latest version. Since you're using latest WPML plugins, it is better to update WP for compatibility improvements.
IMPORTANT: Please take full backup of your website and database beforehand.
It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.
Please let us know your findings and we'll try our best to help you further on the matter.
Hi Waqas, thanks for looking into this for me. I've added the default language switcher (please see screenshot) and the result is the same.
Would this have something to do with the fact that the ES blog version permalink is using /news/ instead of /noticias/? I cannot find a way to update the permalink structure for all posts that are being translated into Spanish.
Hi Cristopher, I expect the values of "href" to be the EN link, not the ES.
For example, these are the lines that I expect to be generated instead of the ones seen in your screenshot. Please compare and observe that we need the EN links under the "en-us" and the "x-default".
Thank you very much, Your explanation gave me an idea what might be the problem cause.
You use the Rank Math SEO plugin that requires our WPML SEO plugin for compatibility.
- 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.
- Please go to WP Dashboard > Plugins > Add New > Commercial (tab)
- Select WPML SEO and click the Download button while the Activate checkbox is checked.
If the issue persists, I'd appreciate it if you could test in a minimal environment:
- 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.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except WPML and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.
Thanks.
The topic ‘[Closed] Wrong ‘hreflang’ meta URL’ is closed to new replies.
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.