7

I'm working on a site where we have many different languages (about 24). When a content piece is authored in English, it is automatically copied to all language sites where it will be later translated to the proper language. Currently, we're using hreflang <link> elements in the head like so:

<link rel="alternate" hreflang="da" href="http://server/da/wiki/some-page/" />
<link rel="alternate" hreflang="de" href="http://server/de/wiki/some-page/" />
<link rel="alternate" hreflang="et" href="http://server/et/wiki/some-page/" />
<link rel="alternate" hreflang="en" href="http://server/en/wiki/some-page/" />
<link rel="alternate" hreflang="x-default" href="http://server/en/wiki/some-page/" />
<link rel="alternate" hreflang="es" href="http://server/es/wiki/some-page/" />
<link rel="alternate" hreflang="fr" href="http://server/fr/wiki/some-page/" />
<link rel="alternate" hreflang="is" href="http://server/is/wiki/some-page/" />
<link rel="alternate" hreflang="it" href="http://server/it/wiki/some-page/" />
<link rel="alternate" hreflang="lv" href="http://server/lv/wiki/some-page/" />
<link rel="alternate" hreflang="lt" href="http://server/lt/wiki/some-page/" />
<link rel="alternate" hreflang="hu" href="http://server/hu/wiki/some-page/" />
<link rel="alternate" hreflang="nl" href="http://server/nl/wiki/some-page/" />
<link rel="alternate" hreflang="no" href="http://server/no/wiki/some-page/" />
<link rel="alternate" hreflang="pl" href="http://server/pl/wiki/some-page/" />
<link rel="alternate" hreflang="fi" href="http://server/fi/wiki/some-page/" />
<link rel="alternate" hreflang="sv" href="http://server/sv/wiki/some-page/" />
<link rel="alternate" hreflang="tr" href="http://server/tr/wiki/some-page/" />
<link rel="alternate" hreflang="ru" href="http://server/ru/wiki/some-page/" />
<link rel="alternate" hreflang="ar" href="http://server/ar/wiki/some-page-2/" />
<link rel="alternate" hreflang="th" href="http://server/th/wiki/some-page/" />
<link rel="alternate" hreflang="ja" href="http://server/ja/wiki/some-page/" />

From my understanding, using x-default is preferred over canonical - is this correct? Also, do we need any additional tags for pages that aren't yet translated (such as noindex or nofollow)? A lot of the resources I've found have been contradictory to each other or not clear on what to do in the case of untranslated (duplicate) content.

1

For HTML5:

If you want to link to a page that contains the same content (in the same language, because it’s not translated yet), you

  • may use hreflang, but the value would have to be the content’s current language, not the language it may be translated into in the future (¹)
  • may use alternate because the document is an alternate representation
  • may use alternate + hreflang (because of the exception linked above: it’s not considered to be a translation if the lang attribute on the html element of the linking document has the same value as the hreflang attribute of the link)

In other words, the markup in your question is invalid, because a) the hreflang denotes the wrong language, and b) from this follows that you denote the linked document would be a translation although it isn’t (at least not yet).

In my opinion, the best solution would be not to link to untranslated pages. Such a link is typically not useful to your visitors: a German user lands on your English page, notes that you link to a German translation, follows that link, and ends up on a different page with the same content still being in English. Same idea with bots: you give them a wrong signal.

Instead, add the link as soon as the page is translated.

If that’s not possible, it can make sense to disallow indexing the untranslated pages by using a meta-robots element with the noindex value or the equivalent X-Robots-Tag header (examples), and/or to use the nofollow link type on links to untranslated pages (depending on which meaning gets used), especially if it might take a long time to translate the content.


(¹) For hreflang, the HTML5 spec only defines that it’s for giving "the language of the linked resource", so it’s not really clear which value to use for, let’s say, a German page (header, footer, navigation, sidebar) with English main content. If you think the value should be de because of the header/footer/etc. (instead of en because of the main content), then using the language tag for the language it will be translated into might be appropriate. In that case, the exception for alternate + hreflang is irrelevant, as you would actually link translations (although the main content isn’t translated).

FWIW, Google lists a similar case as first example for their hreflang guidelines:

You keep the main content in a single language and translate only the template, such as the navigation and footer. Pages that feature user-generated content, like forums, typically do this.

  • > If that’s not possible, it can make sense to disallow indexing the untranslated pages by using a meta-robots element with the noindex value. Don't do this. If you do this, Google will complain about missing return tags. – tinkerr Mar 10 '16 at 0:41
  • @NickJasuja: Interesting. Why’s that, as the Googlebot would be able to check the linked page (in case of noindex) to see the link back (assuming that’s meant with "return tags"?). Anyway, would this be problematic, or is this just informational? – unor Mar 10 '16 at 1:20
  • It will be problematic. If a page cannot be indexed by Google, then Google cannot record the hreflang (return) tags on that page. So there will be an error for missing return tags. – tinkerr Mar 11 '16 at 14:17
1

Use x-default for the default version of your website that you haven't targeted yet by another hreflang. For your information, Google don't mention canonical.

reference: https://googlewebmastercentral.blogspot.fr/2013/04/x-default-hreflang-for-international-pages.html

From your code you have added to your question i can see a misconfiguration

<link rel="alternate" hreflang="en" href="http://server/en/wiki/some-page/" />
<link rel="alternate" hreflang="x-default" href="http://server/en/wiki/some-page/" />

Your x-default line already points to english. So you don't need to add it again except if you want to mention the region too. For instance, if you want people from all over the world who speak english to end up on your default page and if you wish people from United kingdom to end up on a specific page:

<link rel="alternate" hreflang="en-gb" href="http://server/en/wiki/some-page/" />
<link rel="alternate" hreflang="x-default" href="http://server/en/wiki/some-page/" />
1

Because this is only for search engines and communicating where to find your site - you could move all of this code over to your Sitemap and submit it in the search engine of your choice's Webmaster interface.

Advantages:

  • Make it as big as you like, without bloating your HTML. There's no limit!
  • No need to worry about confusing header link structures.
  • You can crawl your own site more easily and still hide links from other crawlers by naming your sitemap something obscure.
  • Generate it programmatically for your entire site.
  • It's easy to have Webmaster scan it for errors (indexing and parsing).
  • One file solution for what will be many pages you have to index and tag.
  • A script can auto-update it as you add content.

Disadvantages:

  • Longer to set up if you're only doing a few pages.
  • You have to update it separately from the HTML, if you're not using a script.

Here is the official Google documentation: https://support.google.com/webmasters/answer/2620865?hl=en

Here is example XML, with the first three links in your post:

<url>
    <loc>http://server/en/wiki/some-page/</loc> <!--The Original Page-->
    <xhtml:link 
             rel="alternate"
             hreflang="da" <!--Alternate language code-->
             href="http://server/da/wiki/some-page/" <!--Link to alt page-->
             />
<xhtml:link 
             rel="alternate"
             hreflang="de"
             href="http://server/de/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="et"
             href="http://server/et/wiki/some-page/"
             />
</url>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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