What is the proper way to setup hreflang tags on my English and Spanish site?
-
I have a full English website at http://www.example.com and I have a Spanish version of the website at http://spanish.example.com but only about half of the English pages were translated and exist on the Spanish site.
Should I just add a sitemap to both sites with hreflang tags that point to the correct version of the page?
Is this a proper way to set this up? I was going to repeat this same process for all of the applicable URLs that exist on both versions of the website (English and Spanish).
Is it okay to have hreflang="es" or do I need to have a country code attached as well? There are many Spanish speaking countries and I don't know if I need to list them all out. For example hreflang="es-bo" (Bolivia), hreflang="es-cl" (Chile), hreflang="es-co" (Columbia), etc...
Sitemap example for English website URL:
<url><loc>http://www.example.com/</loc></url>Sitemap example for Spanish website URL:
<url><loc>http://spanish.example.com/</loc></url>Thanks in advance for your feedback and help!
-
Sorry for viewing this just now... but - forgive me if I am wrong due to a bad understanding of the question - but I think Tom answer is not correct.
You are telling that your main site is in English, but that has also a Spanish subdomain with just half of it localized in Spanish.
If this is the correct interpretation of the origin of your doubts, than, in the Spanish subdomain the hreflang should be implemented so:
IN CASE OF SPANISH SUBDOMAIN URL WITH SPANISH CONTENT
<loc>http://www.example.com/</loc>
IN CASE OF SPANISH SUBDOMAIN URL WITH ENGLISH CONTENT
<loc>http://www.example.com/</loc>
Why? Because those "en" and "es" mean "English Language" and "Spanish Language", so you cannot declare as Spanish something that Spanish is not. As well you cannot declare both URLs as to shown to English speaking users, because that would create an hiccup to Google, who would not know what of the two it has to finally show to English speaking users.
More over, if you don't want to extend the use of the hreflang suggesting also the countries where to show some given URL, then you should canonicalize the spanish.domain.com URL with English content to the original www.domain.com URL.
The idea of using also the country code ISO could solve - somehow - this issue, because writing something like this:
<loc>http://www.example.com/</loc>
Then you will be telling Google to show the spanish.domain.com URL to the people using english in Spain (Google.es), and the English one to all the people speaking English in the rest of world.
Be aware, though, that Spanish people using Spanish will see in the www.domain.com URL in their Google.es SERPs, because the x-default is telling Google that all the people not using the language indicated in the hreflang="x-X" annotation (which is English), will have to see the main domain URL, and not the spanish subdomain one.
Hreflang is quite a sudoku, but it is extremely logic.
-
Thanks Tom for your input and feedback.
-
Hi,
To answer your first question, using hreflang tags in your sitemaps is a perfectly fine implementation of the tags, they will work whether they’re coded into the of each page, set in the sitemap or set in HTTP headers. This page will be useful for you as it explains all three methods quite well: http://www.branded3.com/blogs/implementing-hreflang-tag/
But when you add them to your sitemap you should include all variations of the page, along with a default – so if a French or German searcher accesses your site, you can define whether they’ll be served the Spanish or English page, like this:
<loc>http://www.example.com/</loc>
To answer your second question about countries, you are fine to use hreflang=”es” to define all Spanish traffic, but using country codes can be useful in some circumstances. For instance if you have a site talking about football, you could use hreflang=”en-us” for a page which refers to the game as ‘soccer’ and use hreflang=”en-gb” for the page calling it ‘football’.
This Google Webmaster support post explains using both quite well under ‘Supported language values’ which I recommend you take a look at as well: https://support.google.com/webmasters/answer/189077?hl=en
Hope that helps,
Tom
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
-
Hreflang vs canonical
I'm having an international Drupal website and the hreflang module is in use. However, I'm still not sure how to optimize the pages. Perhaps it's easier to ask with an example **International: **www.example.com/products/product1
International SEO | | Teklan
Here we have the master content of the product **US: **www.example.com/us/products/product1
Here we have exactly the same content as international. Nothing is localized. **UK: **www.example.com/uk/products/product1
Here we have almost the same content as on International. Here and there some local terms and extra text. **German: **www.example.com/de/products/product1
Here we have a translated version of the international page. Questions Do I add hreflang from all to all pages + to itself? Where do I add canonicals? How should I optimize the content on the US and UK pages?0 -
UK English and USA English - two flags on navigation?
If a website is translated to English and has .co.uk version and a .com which are directed at UK and USA audiences respectively (using localised spellings etc), how do you get the visitor to the right version? It seems clumsy to add two flags on the navigation - one for USA and one for GB English as well as other languages. Should a redirection script be in place based on their IP address? Thanks for any help
International SEO | | AL123al0 -
Which will rank higher: Non-mobile friendly site in native language vs. mobile friendly global site in English?
Hi, we are currently implementing a mobile site, e.g. m.company.com. The global mobile site will only be available in English. We have local subsites of the desktop site, e.g. company.com/fr. The local subsites are not mobile friendly. If a user does a search for a brand term in France, **which site will rank higher in SERPs? **If it will be the global site, is there anything we can do (other than making them mobile friendly) to make the local sites rank higher? Would it be the mobile-friendly site, even though it is only in English, because the local site would be penalized for not being mobile friendly? Or would it be the local site, because Google will give priority to the fact that it's in French, which matches the language of the person searching?
International SEO | | jennifer.new0 -
Multilingual Site with 2 Separate domains and hand-translated
I have 2 separate domains: .com & .jp
International SEO | | khi5
I am having a professional translator translate the English written material from .com. However, the .jp will have same pictures and videos that I have on the .com which means alt tags are in English and video titles are in English. I have some dynamic pages where I use Google Translate and those pages I place as "no index follow" to avoid duplicate issues and they are not very important pages for me any way. Question: since I am doing a proper translating - no machines involved - can I leave pages as is or should I include any format of these: ISO language codes
2) www.example/com/” /> Even though hand translated, the translation will probably be 85% similar to that if I used Google Translate. Will that potentially be seen as duplicate content or not at all since I have not used the Google Translate tool? I wonder from which angle Google analyses this. Thank you,0 -
Alternate tag. Anybody had success getting English websites only with localized currency served with alternate tag?
I have an English website with USD prices and US phone.
International SEO | | lcourse
Via currency dropdown visitors in Ireland can choose EUR as currency, visitors from Denmark Danish crown etc and via GEO IP I also serve local contact phone numbers. So I though it made sense to define this with the alternate tags, but now after several months google still does not pickup these pages in local searches. Did anybody have success with getting a website just with currency parameter ranked locally using the alternate tag? Does it help to have also static links (not only dropdown links) to currency versions on the page? Any other thing that could help to have google pick these up? Below my code sample:0 -
Links metrics & rel="alternate" hreflang="x"
Bonjour! If with rel="alternate" hreflang="x" we can indicate to Google that an URL have translated equivalents of a page, are the links metrics splited between all pages or Google considers all the pages as only one? Thanks! Maxime
International SEO | | Maxoulala0 -
Improving Search Rankings in other Countries for an existing site
Hello SEOmoz, I have a very well respected international client who ranks high in the US and for English language Google search results worldwide. However, the client's foreign language pages for specific countries do not show up on the first page of SERPs in those specific countries. The foreign nation/language pages are served on the same root domain as the main English language site it this fashion: www.client.com/france www.client.com/brazil Here are my questions: What can we do from an SEO standpoint to improve SERPs in Google.fr or other countries What is the best way to prevent duplicate content errors or prevent the wrong page from being indexed abroad. What are some best practices when using Google Webmaster tools in this regard? Thanks
International SEO | | BPIAnalytics0 -
Reciprocal Links between my own sites ?
Is is ok to have Reciprocal Links between sites you really own ? We have a website that has been regionalized to 5 countries, using 5 different domains. The content is exclusive for the country but the keywords used might be similar. We have all the domains under the same Analytics account and all of them share the same Adsense code. Can I be penalized by Google for making reciprocal links between them ? Is something usefull for improving the SEO rank or I should avoid doing it ? Thanks in advance
International SEO | | martincad0