HREFLANG Sitemap Tool

Introduction – rel=”alternate” hreflang=”x” XML Sitemap Tool

One of the biggest difficulties with international SEO is the successful targeting of the correct website to the correct region, so that search users in a particular region find the site that is aimed at them.

One new and extremely useful solution to this problem are rel=”alternate” hreflang=”x” XML sitemaps. These allow you to tell Google what versions of your content you want to have showing up in search results for various targeted regions/languages, which is particularly effective when you have one powerful website ranking in all regions, despite having specifically targeted pages/sections for that area/language.

After doing a lot of research and work for implementing rel=”alternate” hreflang=”x”, which we documented in this blogpost, we decided to create an XML sitemap generator to help assist others with the implementation of this work.

Users of this tool are assumed to have a good grasp of rel=”alternate” hreflang=”x” and already have a map of what equivalent pages they want to be targeting for each specific region.

Usage Instructions

This tool allows you to upload a CSV (comma separated values) file with a map of your pages targeted to each specific region/language to create your rel=”alternate” hreflang=”x” XML sitemap.

Each column header needs to contain the country and language code – i.e. for an English language, internationally targeted site, it would be “en“, English Language for British users it would be “en-gb“, whilst English language for Australian users would be “en-au“. For a more comprehensive list of languages, the Wikipedia has a List of ISO 639-1 codes, whilst the country codes for regions are also found on the Wikipedia – ISO 3166-1 alpha-2.

See the Google guidelines on rel=”alternate” hreflang=”x” and Sitemaps: rel=”alternate” hreflang=”x” for more info.

The first column of the CSV needs to have the URLs from the website that this sitemap will be uploaded to (as this will be the “location” that the equivalents are marked against).

The next columns will have a reference to the URL most suitable for the region/language specified in the column header.

You need to have a list of URLs, with their equivalents for each region all on the same rows within this csv, like the example URL map below:

Example URL Mapping

Each row should then contain the relevant links from each website (see above).

Please note that each row must have an element for each country supplied.

Save the file as a CSV (.csv) and upload using the form below. You will then be presented with a Download XML button. Click that and your file will download.

Note based on Feedback: This tool works best at present for implementing this across different domains/sub-domains, and you need to create a sitemap for each (with that countries URLs in the first column). Tweet @ismepete if you are using this on one domain, and I’ll help out accordingly.

Get Started

Shortlisted EU Search Awards 2013Wirehive 100LRT-AssociateSearch Awards Judge 2012Hampshire Chamber of Commerce