Hreflang tags and canonical tags - might be causing indexing and duplicate content issues
-
Hi,
Let's say I have a site located at https://www.example.com, and also have subdirectories setup for different languages. For example:
https://www.example.com/es_ES/
https://www.example.com/fr_FR/
https://www.example.com/it_IT/
My Spanish version currently has the following hreflang tags and canonical tag implemented:
My robots.txt file is blocking all of my language subdirectories. For example:
User-agent:*
Disallow: /es_ES/
Disallow: /fr_FR/
Disallow: /it_IT/
This setup doesn't seem right. I don't think I should be blocking the language-specific subdirectories via robots.txt
What are your thoughts?
Does my hreflang tag and canonical tag implementation look correct to you? Should I be doing this differently?
I would greatly appreciate your feedback and/or suggestions.
-
Hi... I'm sorry to tell you that the answer offered by Gaston is not totally correct.
So, in your Spanish page you have these hreflang and canonical annotations:
This is not correct because you are not adding also the self-referential hreflang annotation
Google is very precise about this, and it states its need in the help pages as well in many Googlers tweets and webmaster office hangouts.
The rel="canonical" is correct. Remember that the self-referential and the alternative href URLs must always be canonicals.
Finally, regarding the subfolders blocked via robots.txt, yes! that's totally incorrect:
if you're blocking Googlebot from accessing the Spanish, French and Italian subfolders, then Googlebot won't be able to parse the code of their pages, hence it won't be able to see also the hreflang annotations... with obvious erroneous consequences.
-
that's corect.
-
Yes. example.com/en-US/ redirects 301 to example.com
So, when referencing that version in hreflang will it look like this?
Is this correct?
-
So, every page of example.com/en-US/ redirects 301 to example.com/ ?
If that's the case, then there is no reason in having that folder (/en-US/), just when configuring Hreflang for en-US use the URL without that folder
-
What do you mean by "exactly the same then there should not be 2 sites"?
My https://www.example.com/en-US/ 301 redirects to https://www.example.com
Thoughts?
-
Yeap, those implementations are correct.
in order to avoid duplicate content between different language/countries websites, in each page that is present on each site, there should be their corresponding hreflang tag.
In your case:
And for a sample page: https://www.smarttechMKT.com/es-ES/gastonriera-espanolNOTE, in the case that site.com and site.com/en-us/ are exactly the same then there should not be 2 sites. Just the one without the folder and hreflang tag with en-US should point to that
Hope it helps.
Best luck.
GR -
Thank you for the response, Gaston! I really appreciate it.
So you are certain that my hreflang and canonical tags are implemented correctly? For example, my Spanish version (https://www.example.com/es_ES/
Is this implementation correct?
Also, will I have any duplicate content issues with these different language versions?
-
Hello there,
Watch out your question, there is a site there. If its your clients, edit it.
Canonical and hreflang seems OK.
Blocking other languages/countries is wrong. There you are allowing google to see ONLY the us version.For further reading, take a look at these articles:
Hreflang:
Multi-regional and multilingual sites - Google Search Console
International checklist - Moz Blog
Using the correct hreglang tag - Moz Blog
Guide to international website expansion - Moz Blog
Tool for checking hreflang anotations - Moz Blog Canonicals:
SEO Best Practices for Canonical URLs + the Rel=Canonical Tag - Whiteboard Friday Consolidate duplicate URLs - Google Search Console HelpHope it helps.
Best Luck.
GR.Hope it helps.
Best luck.
GR.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Why Google Is Changing our Title Tags?
Hi fellow Moz SEOs, Need your URGENT help! We set an optimised title for our client websites. These titles are approved by our clients. When they checked on Google, noticed the title was not the same. They notified me about this issue. The title looks fine when I checked the source code. Why Google set our title differently? For example: Title approved by client: Heart Specialist Clinic Singapore | Cardiology Clinic | Dr. Lim Ing Haan
International SEO | | Verz
**Google set our title: **Dr. Lim Ing Haan: Heart Specialist Clinic Singapore ... Title approved by client: Hernia Surgery Singapore | Arden JR Surgery
**Google set our title: **Arden JR Surgery: Hernia Surgery Singapore Title approved by client: Top Specialist Divorce & Family Lawyer - Yeo & Associates LLC
Google set our title: Yeo & Associates LLC: Top Specialist Divorce & Family Lawyer Title approved by client: Child care Centre in Singapore| Top Preschool | Carpe Diem
Google set our title: Carpe Diem: Child care Centre in Singapore| Top Preschool Every day, they are requesting me to update Google's title with their approved title. Also, asking me these questions.
Why did this happen?
Why didn't set their recommended title? Is there any way to set our approved titles? Please, help me to find the solution. ASAP Thanks in advance!0 -
Sitemap issue
On this link you can see the sitemap: http://bit.ly/2XC9J5G.
International SEO | | vanGoGh-creative
I don't understand what the error is.
From the search console I have the following indication: "The XML Sitemap cannot be analyzed because it contains one or more prefixes of the unassociated namespace. For example, the error is generated when xhtml:linknot preceded by xmlns:xhtml="http://www.w3.org/1999/xhtml" is detected in a Sitemap.
Will you help me, please solve?
Thank you very much.</xhtml:link> Massimiliano0 -
When should hreflang be deployed in this situation; now or later ?
Hi I have a question in regard to point 1 in Gianluca Fiorelli first comment on Aleyda Solis old but great international targeting article in regard to hreflang: https://moz.com/blog/using-the-correct-hreflang-tag-a-new-generator-tool it would obvs be amazing if either Gianlucca or Aleyda can answer but if anyone else feels they can do so confidently then that would be great too 🙂 I'm advising someone in similar situation as that (their main brand is USA based on a .com showing up in UK searches too) and they have launched .co.uk sites (without any seo) to target UK brand searches, so obviously the .com is still dominating UK serps for brand, and the .co.uk is ranking on page 4 on average for a brand search. **BUT **before I tell them to roll out hreflang shouldn't they build up some authority etc first for their new country specific (.co.uk) site ? since they are very new and have no authority or even basic SEO and don't rank higher than page 4 for brand searches (the .com is in no1 in both usa and uk). I know hreflang needs to be used correctly here but im not sure when it should be, now or later (after authority has built up for the new uk focused sites) ? In other words I take it deploying the hreflang correctly wont simply cause these home pages to swap positions for brand search in uk (or will it) ? Im worried deploying it immediately could actually destroy the brands current page 1 serps for brand term (since will remove the .com page from the uk serp). Hence i take it its best to build up the new .co.uk sites seo/authority etc first and at least get that sites brand ranking moving up the listings before deploying hreflang on the .com, to then hopefully remove the .com listing in place of the .co.uk for brand ? OR does Gianlucca point in his comment suggest that correct hreflang usage on both sites should swap the high authority .com no1 position with the low authority .co.uk for a brand search ? Many Thanks Dan
International SEO | | Dan-Lawrence0 -
GeoIP Redirects & hreflang
Hello, We believe we've had some issues with hreflang tags not remaining validated due to the implementation of geoIP redirects. Previously, if a user clicked a landing page on Google search that was not targeted for their territory, they would instantly be redirected to a sub path that targets their territory using geoIP redirects. We're planning to remove the initial geoIP redirects and have messaging that prompts the user to either stay on the page they've landed on, or be redirected to page that is right for their territory. However, if a user has selected to be redirected to a sub path that is targeted for their territory, they will have a cookie preference set for the IP location they've selected, and will continue to be redirected to their chosen sub path. My question is, will a crawler follow and trigger the geo preference cookie, which could potentially cause complexities in validating hreflang tags and ranking of content for the right market. Thanks.
International SEO | | SEONOW1230 -
Will hreflang with a language and region allow Google to show the page to all users of that language regardless of region?
I'm launching translations on a website with the first translation being Brazilian Portuguese. If I use the following hreflang: If a user is outside of Brazil and has their browser language set to just Portuguese (Not Portuguese (Brazil)) will Google still serve them the Portuguese version of my pages in search results?
International SEO | | Brando160 -
Hreflang problem?
Hello, We do have a client with a site in multiple versions (one domain per country). French and Spanish versions work really fine, but the problem comes up with the .com and .co.uk versions. This is my hreflang piece of code: When I go to Google.co.uk and search the exact match domain keyword "how much cost an app", I only find the howmuchcostanapp.com domain (1st or 2nd page) instead of howmuchcostanapp.co.uk. The UK one is not appearing! This is very strange. I have spent a lot of time trying to solve this, but I don't know what else to do. Thanks a lot in advance for your comments and help!
International SEO | | Yeeply.com0 -
Hreflang for bilingual website in the same region/location
Hi everyone, got a quick question concerning the hreflang tag. I have a website with 2 different language versions targeting to the same region(Reason: The area is bilingual however not everyone speaks the other language fluently) Question:
International SEO | | ennovators
Can I use hreflang in that case like: Many thanks in advance0 -
How to fix the duplicate content problem on different domains (.nl /.be) of your brand's websites in multiple countries?
Dear all, what is the best way to fix the duplicate content problem on different domains (.nl /.be) of your brand's websites in multiple countries? What must I add to my code of websites my .nl domain to avoid duplicate content and to keep the .nl website out of google.be, but still well-indexed in google.nl? What must I add to my code of websites my .be domain to avoid duplicate content and to keep the .nl website out of google.be, but still well-indexed in google.nl? Thanks in advance!
International SEO | | HMK-NL3