What Is Hreflang and How To Implement It the Right Way

April 01, 2024

How Hreflang WorksThe hreflang attribute is added to a webpage’s link element (<link>) in the <head> section or HTTP header. To implement hreflang, you should include a separate link element for each language or regional version of your page. How to Properly Implement Hreflang in HTMLTo effectively implement hreflang attributes and help search engines identify the right version of your site, follow these steps:Identify which languages and countries your website is targetingDecide where to put your hreflang attributesSet up your hreflang tags the right wayStep 1: Identify Target Languages and RegionsYour hreflang attributes need to match the language and regional versions available on your website. So don’t just do this:<link rel="alternate" hreflang="en-US" href="https://www.yourwebsite.com/en-us/" /> <link rel="alternate" hreflang="es-MX" href="https://www.yourwebsite.com/es-mx/" />Add the canonical link element, too. This means that when you’re adding hreflang attributes, each hreflang link element must be a different URL.

The source of this news is from Backlinko