Defining Alternates

Alternatives of a page can be set where there are other versions of this content that are specifically modified for either different devices or geographic/language targets.

<link rel="alternate" ... href="http://www.example.com" />

The alternate tag tells search engines where to find other versions of this page which may be more appropriate for users on a case-by-case basis. This tag does not have any effect on a user’s browser or experience – it only influences which URL search engines return to users on search result pages.

Language or Territory Alternates

<link rel=“alternate” hreflang="target" href="[alternate url]" />

By adding the ‘hreflang’ variable into an alternate link tag, you are telling search engines where it should send users who prefer pages in the defined language. This can also be used to segment users from different countries who speak the same language, as this includes an optional region code.

All alternate pages must be defined reciprocally. For instance, in a situation where one page has four targets – English, English users in Britain, English users in Australia, and French users, the following code should appear on all pages:

In the case where only hreflang is being implemented, all canonicals should be self-referential.

Device Specific Alternates

When you have device-specific websites on different URLs to the desktop site, you should use the alternate link tag with a media query to tell search crawlers where they should send users on these devices.

Contrary to the requirements for hreflang, when implementing alternate tagging with a media query, the alternate tag only needs to be on the desktop site; the device-specific webpage(s) should canonicalise back to the main desktop page.

Using Both Hreflang and a Media Query in one Alternate Tag

It’s possible to use both the hreflang and media query in the same alternate tag, for instance if you want to tell search engines to send British users on a mobile device to a specific page for mobile users in the UK.

In this case, the mobile page should canonicalise to the British desktop version of this page.

On-Device App Alternates

If you have an app that could be used in place of the webpage (i.e. a mobile user can open a Facebook brand page on either their mobile browser, or from within the Facebook app), you can define the link to your app and search engines (at the time of writing, only Google) will offer users the option to launch a page in your app directly from the search result page.