[Resolved] hreflang conflicts within page source code
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to resolve hreflang conflicts within the page source code and are seeing errors in Google Search Console or Semrush related to hreflang.
Solution: We recommend excluding query parameters from hreflang tags for optimal SEO performance. Here are the steps you should follow: 1. Ensure hreflang tags point to the canonical versions of pages, intentionally excluding query parameters to avoid confusion for search engines. 2. This approach helps prevent duplicate content issues and improves search engine indexing by helping search engines recognize the primary version of each page. 3. Verify that the canonical tags on your pages correctly point to the main site without query parameters. You can check this by viewing the page source and looking for the canonical link tag. For more detailed guidance, please refer to the following resources:
If the solution provided here becomes irrelevant due to updates or does not apply to your specific case, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.
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 resolve hreflang conflicts within the page source code. The issue can be seen on this page: hidden link.
Symptoms:
I expected to see no conflicts in Google Search Console or Semrush. Instead, I got errors on the following pages: hidden link, hidden link, hidden link.
Questions:
How can I resolve hreflang conflicts in the page source code?
Why am I seeing errors in Google Search Console or Semrush related to hreflang?
Reference to our recent chat, can you please clarify about the following?
- The issue about ?attribute_pa_size=250ml-de in the URL, is it coming from GSC or Semrush?
- Can you please get more details from Semrush about what exactly is the problem?
As I discussed with the team they want to know about the above mentioned. WPML is Google-complaint while for 3rd party complaining about this, we need more detailed information.
Hey there Philippe! Thank you for your query 😊 My name is Tatiana and I will be happy to assist you further 🤗
I have checked this report and indeed can see some issues with the hreflang tags, for example, let's have a look at this URL hidden link ->
<link rel="alternate" hreflang="en" 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" />
As you can see, there are different hreflang tags, however, there is no self-referencing hreflang -> in this case, it should match with the initial URL hidden link 🙌
Additionally, the canonical tag points to a different URL <link rel="canonical" href="hidden link" />, hence it's in conflict with the hreflang="de" tag💥 -> here are more details.
If the page is not canonical (its canonical tag points to another page) it doesn't need hreflangs at all. Hence, you should make sure to specify a self-referential canonical tag -> here is a case example 👀
I discussed with the team, as well as, searched our forums for existing reports. Looks like there's a misunderstanding caused by these errors, which are against SEO rules.
In a nutshell, excluding query parameters from hreflang tags is the correct and recommended approach for optimal SEO performance.
Here are the reasons:
- Hreflang Tags and Canonical URLs: Hreflang tags should point to the canonical versions of pages, intentionally excluding query parameters to avoid multiple URLs leading to the same content, which can confuse search engines.
- Preventing Duplicate Content Issues: Including query parameters could lead to search engines indexing multiple versions of the same page, potentially resulting in duplicate content penalties.
- Improved Search Engine Indexing: By pointing hreflang tags to canonical URLs without query parameters, it helps search engines recognize the primary version of each page, enhancing SEO rankings.
We recommend verifying that the canonical tags on your pages are correctly pointing to the main site without query parameters. You can check this by viewing the page source and looking for the canonical link tag.
In short, if the canonical is added properly, please don't worry about the warnings or errors that appear in the SEO analysis. Rest assured that those warnings are not a cause for concern. But, you can always discuss with a SEO specialist regarding this matter.