How To Implement The hreflang Element Using XML Sitemaps

After much confusion and frustration from multilingual site webmasters on how to properly use the hreflang element, Google announced new functionality to allow multilingual and multinational site owners to set the rel=”alternate” hreflang=”x” link annotation using XML sitemaps.

This is a much better way of implementing it than telling webmasters to add hundreds of lines of code to their pages while simultaneously telling them to reduce lines of code.

Help For Multiple Language Countries

There are countries like Canada, Switzerland and Belgium that have multiple national languages and/or large populations that speak different languages resulting in companies creating specific language versions for these markets.

Previously, we had no way to set both a country and languages since Webmaster tool’s Geographical Settings were for countries only.

For example, Switzerland we could only tell Google that the German, French and Italian versions of the site were all related to Switzerland but not designate a language for them.

With this new functionality, we now have the ability to designate a section of the site for the German speaking part of Switzerland and another part of the French speaking. We can easily do this by adding these entries to the XML sitemap or by using the link element as Google initially deployed.

To make the entry for Switzerland,we would add the following to our XML site map.

Country Homepages

Companies should deploy a specific XML sitemap with their country homepages as soon as they can to start benefiting from this location setting especially with their English and Spanish sites. Note, you can incorporate this into your normal site map process later but for now you can get it live and reap the benefits.

As the image below shows, simply take your global homepage then create an entry for each of the country/language versions which will help Google understand that they are actual local market versions.

The frustrating thing for me as that most multinationals have already told Google this same information via their Webmaster Tools Geographical targeting function which Google seems to be totally ignoring.


Global & Local English Pages

Many multinational have used their global site as their US site, which has forced them to either, make it US only or global and thereby causing problems in English markets like the UK and Australia.

Using the hreflang element, multinationals can easily designate the global page as being global English [en] and then designate the local market versions as being local-language specific.

Some initial tests show that it has helped some of those sites that are penalized by having multiple English versions of the site in different countries.

XML Sitemap Code Bloat

The size of the XML sitemaps will be a challenge for multinationals when they add these elements since they will expand significantly.

Typical entries use between one to six rows in a XML file, but now they will grow to as many as 100 or more for each URL which needs to be taken into consideration when building them due the max size limitations.

While standards say the max size is 50,000 URL’s we have found that 5k to 10k URL’s is a more manageable number and we will have to reduce the number of URL’s included further to accommodate the increased file sizes that come with adding all of the hreflang versions making the management of site maps and index files a bit more complicated.

XML Sitemap Development Tools

None of the popular XML site map tools have added this functionality yet but I suspect some of them will. This will be a pretty complex undertaking since you will need to match pages to each other and then make the entries.

For many companies that have uniform URL structures, this will be easy to replicate but for others that have Frankenstein sites as in one case the company had 57 different URL versions to represent the same page in multiple countries.

Until the tools evolve, you can develop these manually for the biggest opportunity markets and your most important content. Hopefully this will be the solution to this massive problem of local content wrapped multinational sites scale being given the same relevance treatment as smaller single country sites.

Opinions expressed in the article are those of the guest author and not necessarily Search Engine Land.

Related Topics: Channel: SEO | Multinational Search


About The Author: is currently the President of Back Azimuth Consulting and co-author of Search Engine Marketing Inc. His personal blog is

Connect with the author via: Email | Twitter


Get all the top search stories emailed daily!  


Other ways to share:

Read before commenting! We welcome constructive comments and allow any that meet our common sense criteria. This means being respectful and polite to others. It means providing helpful information that contributes to a story or discussion. It means leaving links only that substantially add further to a discussion. Comments using foul language, being disrespectful to others or otherwise violating what we believe are common sense standards of discussion will be deleted. Comments may also be removed if they are posted from anonymous accounts. You can read more about our comments policy here.
  • Ryan Grant

    Thanks for this. Being in Canada we have a few clients who have both French and English variations of the site. I look forward to implementing this very soon. 

  • BondMarissa

    my friend’s mother-in-law makes $85 every hour on the computer. She has been out of a job for 6 months but last month her paycheck was $19177 just working on the computer for a few hours. Read more her

    ⇛⇛⇛⇛► (Click At My Name For Link)

  • RichardsonLoretta76

    my best friend’s sister-in-law got paid $14696 the prior month. she is making money on the inte<!–truth is almight–>rnet and bought a $372500 home. All she did was get blessed and work up the steps uncovered on this link 

    ⇛⇛⇛⇛► (Click At My Name For Link)

  • BooneOfelia99

    my roomate’s ex-wife brought home $19224 the previous month. she is making income on the internet and moved in a $491500 condo. All she did was get lucky and try the instructions laid out on this web page

    ⇛⇛⇛⇛► (Click At My Name For Link)

  • GilesJuliana

    my roomate‘s sister makes $82/hour on the laptop. She has been out of work for six months but last month her check was $19771 just working on the laptop for a few hours. Read more on this site

    ⇛⇛⇛⇛► (Click At My Name For Link)

  • JP Jokinen


  • Ryan Pitcheralle

    Found this tool to automate this process… Free too.


Get Our News, Everywhere!

Daily Email:

Follow Search Engine Land on Twitter @sengineland Like Search Engine Land on Facebook Follow Search Engine Land on Google+ Get the Search Engine Land Feed Connect with Search Engine Land on LinkedIn Check out our Tumblr! See us on Pinterest


Click to watch SMX conference video

Join us at one of our SMX or MarTech events:

United States


Australia & China

Learn more about: SMX | MarTech

Free Daily Search News Recap!

SearchCap is a once-per-day newsletter update - sign up below and get the news delivered to you!



Search Engine Land Periodic Table of SEO Success Factors

Get Your Copy
Read The Full SEO Guide