If you have, or are planning to have, an international website that targets multiple regions, then you’ll want to use hreflang tags to tell search engines who your website is for; it’s part of international SEO fundamentals. But what is the x-default hreflang attribute and how can it help your international SEO strategy? Find out more about our explore more international SEO service.
What is the x-default hreflang attribute?
Firstly, it’s important to understand what hreflang attributes are: they tell Google which country and language are represented on your website’s content. Hreflang tags are particularly helpful when pages have a similar meaning/purpose but are aimed at different languages/countries. Essentially, they tell Google that you aren’t duplicating content but targeting different regions. Our guide to hreflang tags covers all you need to know.
So, hreflang=”x-default” tags are handy because they allow you to set a default country and language. When your website appears outside of the language region specified in the code, a default website will appear.
What does the x-default attribute look like?
This is what the x-default hreflang attribute looks like:
<link rel=”alternate” href=”http://example.com/” hreflang=”x-default” />
You may have multiple different versions of your site for different regions that might look like this:
<link rel=”alternate” href=”http://example.com/en-gb” hreflang=”en-GB” />
<link rel=”alternate” href=”http://example.com/en-us” hreflang=”en-US” />
<link rel=”alternate” href=”http://example.com/en-au” hreflang=”en-AU” />
The x-default attribute will then be used if your site is accessed from a different location. You can set your x-default as a certain language, for example:
<link rel=”alternate” href=”http://example.com/en-gb” hreflang=”x-default” />
In this case, the default version of your website will be targeted towards users living in the UK.
When should you use a x-default hreflang?
The x-default hreflang is by no means a requirement for all websites. Without having an x-default in place, Google will identify and choose the version of your website to show in the search results. Our content localisation guide can help you understand how to target your website for specific regions. However, there are certain scenarios where you’ll want to implement the x-default attribute:
- Allow users to select their country or language before entering your site — some websites require you to pick your country or language preference before redirecting you to the relevant page. This page won’t be tied to a specific country/language, it asks the user to make the selection instead. This means that this will be the only page using an x-default.
- Display your global site when there’s not a local version available — you may have various country-specific versions of your site. However, when there isn’t a local version available in a certain country, you can use the x-default attribute to display your generic global version instead.
- You have multiple versions of your website — when you have multiple versions of your website to serve different countries/languages, it’s worth setting a default to help Google understand your site better.
How do you implement an x-default attribute on a website?
To set your website’s x-default attribute, you can add it to the <html> tag:
<link rel=”alternate” href=”http://example.com/” hreflang=”x-default” />
You can do this on a page-by-page basis, rather than setting it globally for the entire website. It depends on what you wish your audience to see.
Should x-default hreflangs be set in English?
This is contingent on who your audience is. X-default is the version of your website you wish to show when you don’t have a specific site for a certain region. Some multinational sites will automatically set their x-default attribute to English in order to cover their bases. If the majority of your audience is English-speaking, this could be a wise move. To find out more, check out our multilingual SEO tips for your international website.
3 mistakes to avoid when implementing an x-default
There are several common mistakes made when implementing x-default that can confuse Google and lead to a poor user experience on your website.
- Setting x-default for multiple countries — for example, if you set the x-default for your site as the US but also en-US, this can confuse search engines as to which country you’re targeting. Ensure x-default is consistent across all regions, if you set the UK site as x-default in the UK, this also needs to be x-default in the US.
- Missing or incorrect x-default tag — failing to implement an x-default tag when you target multiple countries/languages can result in missing out on a large audience. Incorrect tags will also further confuse Google and prevent your site from appearing in SERPs.
- Specifying more than one URL on your x-default — this mistake causes Google to ignore your x-default and simply decide which URL to use as it’s not clear which page to direct to. You must ensure your x-default hreflang attributes don’t conflict with one another.
The x-default attribute can be extremely helpful when no other page is better suited. It enables you to still appear in search results and won’t target users with a location-specific site that isn’t relevant to them. It can also be helpful to provide users with a choice to select the right version for them. Need advice or support with hreflang tags? Then an international SEO agency can help you to implement these changes.