Hreflang XML Sitemaps for Multi Country Sites

Having recently consulted on, and implemented a multi country site for a client, I thought it was a good opportunity to share what has been learned on this project.

Previous multi-country rollouts I have worked on have been relatively straightforward, either utilising a separate domain name (and website) for each country, or a subdomain. They have also been relatively small sites, with only ~100 pages that need Hreflang tags applied.

This new project was also the first WordPress sub-folder setup I have been involved with.

Why use subfolders?

In this international expansion scenario, the client already had one relatively powerful website with a lot of high quality established content. Creating sub domains, or separate websites for each country would take too long to start ranking and it was decided that using the authority of the established domain would in effect enable the new countries in the international expansion to hit the ground running.

Despite ordering a powerful Virtual Private Server (VPS) with:

  • 8 GB of Ram
  • 30 mb/sec IO
  • 2 CPUs

Adding a second instance to the hosting environment meant that, almost immediately we experienced issues crawling the additional instance, due to the slow response time:

server response time

Google Search Console for this site had many pages with the status of “Discovered – currently not indexed”, which is defined as:

“The page was found by Google, but not crawled yet. Typically, Google wanted to crawl the URL but this was expected to overload the site; therefore Google rescheduled the crawl.”

Google recommends an average response time of 100-200 second response time (at least less than 1000ms). As you can see from the crawl request diagram above, the response time is never below 1000ms.

This meant that it had taken longer than a month to crawl and index the 1200 pages on this site.

Lessons learnt

Optimise the website before cloning it. Only take a website that is fast, with optimised code and compressed images that pass core web vitals to be cloned. Otherwise, any performance issues that are masked by a fast server will suddenly become apparent and will put additional load on the server.

Sitemaps & Hreflang

Here is a brilliant quote from John Mueller (Google Search Liason), which sums up implementing Hreflang for SEOs:

As much of the content on the site is duplicated, but customised for the language and location, there was a lot of Hreflang work that needed to be done on the sites to influence the search engine indexing the correct country variant in the correct search engine.

Thankfully, in this case, it was pretty simple, as the countries are New Zealand and Australia, but still, Hreflang values need to be set.

Many excellent plugins make it easy to add Hreflang values on a page-by-page basis, but how Hreflang functions, is that there always needs to be two links for each page, as Hreflang is bi-directional.

Here is an example of the Hreflang values that needed to be added to the client site:

<xhtml:link rel=”alternate” hreflang=”en-au” href=””/>

<xhtml:link rel=”alternate” hreflang=”x-default” href=””/>

<xhtml:link rel=”alternate” hreflang=”en-nz” href=””/>

The first attempt was to use the Hreflang tags plugin: After adding a few entries on both servers, it was realised that it would be extremely time-consuming to add these Hreflang values via the plugin to all 1200 pages on the site, plus the 1200 pages on the NZ site. I estimated the process would take in the realm of one week to complete (and likely result in a repetitive strain injury!). So I needed to find a faster method.

As a result, I switched to implementing Hreflang via XML sitemaps instead, as this is much faster to implement and easier to manage as the site grows with subsequent country instances added.

How to build an XML Sitemap with Hreflang?

I first tried using SEO Powersuite’s excellent website Auditor, which has a very user-friendly module that allows you to create an XML sitemap with Hreflang values.

The issue I encountered is that you can’t save defaults, such as the language and location, so it would still take an estimated 6-12 hours to build the sitemaps with Hreflang values:

The eventual Hreflang sitemap solution I implemented

Using Merkle’s Hreflang Sitemap Generator + Excel + Screaming Frog was the solution that worked the best for us in this project. This is the process that was followed:

  1. Download the XML sitemap template
  2. Run a screaming Frog crawl to identify all the HTML URLs
  3. Open Excel and paste these source URLs into the first column
  4. In a simplistic site structure, such as this project, where the domain name just has /nz/ appended to the end of the URL, I ran a simple formula in Excel to append the country sub directory to the end of the URL: =REPLACE(A2, 35+1, 0, “/nz”) to populate the second column with the appended /nz.
  5. I then took the second set of URLs with the appended /nz/ and added them to the sixth column in the hreflang field of Merkle’s template (as per below)
xml hreflang sitemap template
A sitemap was then created using Merkle’s sitemap generator (same link as above) and it created a sitemap like the below:

The sitemaps can then be tested for Syntax errors using Merkle’s Hreflang Tags Testing Tool:

Manual Sitemap Management

One of the downsides of using XML Sitemaps to manage your Hreflang, is the need to manage these sitemaps manually, rather than using an SEO Plugin to manage the sitemap for you. This creates a few headaches, including:

The sitemaps need to be uploaded (via FTP) manually to your hosting environment and changed when URLs are changed, added & removed.
Adding to the difficulty, many SEO Spiders don’t have the ability to manually specify the sitemap location (and don’t have the ability to add a second sitemap to be referenced for subsequent instances). This makes it very difficult to catch any Hreflang configuration issues.

I found Screaming Frog handles this effortlessly, identifying unlinked URLs, missing return links etc:

screaming frog hreflang audit

Ongoing Sitemap Management

I run a crawl every week to check for any new Hreflang issues and update both sitemaps regularly and submit them to Google Search Console, as new pages are added to either site.

Is this solution scalable?

Yes, it should be. As new countries are added to the site, the sitemap can be amended to add hreflang values for any new countries that are added.


Hreflang XML setup for multi country sites can be difficult. Ensure your site is optimised before considering cloning it, and ensure you have enough server resources to handle the additional content + traffic. Merkle’s sitemap generator + Screaming Frog + Excel was the best solution I could find to partially automate the building the XML sitemaps.