2

I have an interesting case and I am lost in it. There are two versions of the site: desktop and mobile. And there are also international versions: English and Spanish. I'm stuck at implementation of canonical tags. Currently my setup has the following:

English (default) desktop page has these:

<link rel="alternate" href="http://www.site.com" hreflang="x-default">
<link rel="alternate" href="http://www.site.com" hreflang="en">
<link rel="alternate" href="http://www.site.com/es/" hreflang="es">
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.site.com/" >

English Mobile page has these:

<link rel="alternate" href="http://m.site.com/" hreflang="x-default">
<link rel="alternate" href="http://m.site.com/" hreflang="en">
<link rel="alternate" href="http://m.site.com/es/" hreflang="es">
<link rel="canonical" href="http://www.site.com/">

Spanish Desktop version:

<link rel="alternate" href="http://m.site.com/" hreflang="x-default">
<link rel="alternate" href="http://m.site.com/" hreflang="en">
<link rel="alternate" href="http://m.site.com/es/" hreflang="es">
<link rel="canonical" href="http://www.site.com/">

Spanish Mobile version:

<link rel="alternate" href="http://m.site.com/" hreflang="x-default">
<link rel="alternate" href="http://m.site.com/" hreflang="en">
<link rel="alternate" href="http://m.site.com/es/" hreflang="es">
<link rel="canonical" href="http://www.site.com/es/">

But I somewhat feel that I messed the things...

Three questions:

1. Could you guys point me to what I did wrong and explain how to set it right?

2. Since I'm redirecting from desktop version of the pages to mobile pages when mobile users access desktop the pages, do I also need to redirect desktop visitors to desktop page versions if they visit mobile pages?

3. Since my pages already have alternate and hreflang references to point to international and mobile versions of the pages, if I add 5 languages of desktop versions and 5 languages of mobile versions to sitemaps, my sitemaps will get bulky. What are the pros and cons for referencing all page versions in sitemap and for include just general (English/Desktop) version in sitemap?

1 Answer 1

3

This looks pretty spot on to me, apart from on the Spanish desktop site set, where there are quite a few errors.

You are referencing the mobile version with the three rel="alternate" hreflang= tags, you should be referencing the desktop version.

The canonical tag on the Spanish desktop is pointing to the English language page. If you need to set a canonical tag it should be pointing to the spanish desktop page (itself). However please note, you do not need to define a canonical tag in the rel="alternate" hreflang= environment for it to work. (in the original specs you did, but no longer). However you can define it should you need it for other duplicate page issues.

You have missed the rel="alternate tag off on the Spanish desktop version pointing to the mobile version of it.

Spanish Desktop version should be:

<link rel="alternate" href="http://www.site.com" hreflang="x-default">
<link rel="alternate" href="http://www.site.com" hreflang="en">
<link rel="alternate" href="http://www.site.com/es/" hreflang="es">
<link rel="canonical" href="http://www.site.com/es/">
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.site.com/es/" >

Google webmaster Tools is now reporting on rel="alternate" hreflang= tag issues, so once implemented you can check how its working there.

With regards to adding all pages to a sitemap.xml file, it's something I practice myself, but you dont have to add every page on your site in xml sitemaps. It is good practice, helps Google find pages, figure out which ones are important and the correct canonical pages.

You could off course use xml sitemaps to add the rel="alternate" hreflang= make up in, instead of in the page code; however this would actually make the xml sitemap files even more unwieldy to manage, lots of repeating of URLs.

2
  • thank you for your answer. Do you think that the canonical tag should go on bottom of these, or better on top? Also, I'm confused with your answer about sitemaps. Can you just give me a simple answer, should I add all mobile and language versions to sitemaps if they are already used on pages or not? You said that you practice the adding them all to sitemaps. But in the end you mean that I'd rather not do that....
    – CamSpy
    Commented Sep 4, 2014 at 5:58
  • It doesn't matter where the canonical tag goes, so add it where ever. Yes I'd suggest you add all your pages to an xml sitemap. What I mentioned is that you can also use xml sitemaps to define rel="alternate" hreflang="x-default" instead of in the pages source code.
    – Max
    Commented Sep 4, 2014 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.