Broaden your SEO Knowledge:
What are hreflang tag attributes?
Did you know there are more than 7,000 languages spoken throughout the world?
When it comes to setting up your website, it’s critical that your content is served to your audience in the correct language. The easiest way to do this is in the Hreflag tag in your header.
How to Declare a Language Tag
It goes without saying that you want to serve your visitors content in the correct language, as this allows them to read it without translation.
To protect against a mishap, you can declare the language of your website in your header.
For example, if your site is built on the WordPress content management system, take these steps:
- Log-in to access the source code of your website
- Click Appearance – >Editor from the left sidebar
- On the right side of the page, click header.php
- Find the HTML tag at the top of the code
Once you take these steps, it’s time to choose the right language tag. Each language tag that you add will include a code. You also have the opportunity to include a region code.
Microsoft shares a comprehensive list of Language Culture Names, Codes, and ISO Values Method. For example, you’ll find the following for English:
Here’s the format you can use to enter the code into your HTML tag:
Do You Have a Multi-Language Website?
A growing number of websites are multi-language, as this helps attract a larger audience. While you can’t add multiple languages in your HTML tag, there are solutions to this problem.
For example, you can use the Polylang plugin for WordPress. With this, you can set an unlimited number of languages for your website. All you have to do is tag the content with the appropriate language, and the plugin does the rest of the work for you.
Example Widgets, Inc has a website that serves users in the USA, Great Britain, and Germany. The following URLs contain substantially the same content, but with regional variations:
- http://en.example.com/page.html – Generic English language homepage that contains information about fees for shipping internationally from the USA.
- http://en-gb.example.com/page.html – UK homepage that displays prices in pounds sterling.
- http://en-us.example.com/page.html – US homepage that displays prices in US dollars.
- http://de.example.com/page.html German language homepage.
- http://www.example.com/ Default page that doesn’t target any language or locale; has selectors to let users pick their language and region.
The HTML that should be pasted into the head section of all the pages listed above. It would direct US, UK, generic English speakers, and German speakers to localized pages, and all others to a generic homepage. Google Search returns the appropriate result for the user, according to their browser settings.
WordPress, along with many other popular content management systems, make it easy to declare the language of your website.
If you’ve yet to do this, review your HTML tag today. This will give you a better idea of which steps to take next.