An HTML tag that helps search engines find and display content in a specific language when a website uses multiple languages. For example, Hreflang tags can help people in the United States find a page in English, while a similar search done in Mexico would return a page in Spanish. Hreflang pages also solve the problem of duplicate content penalties. Hreflang tags help search engines understand when content is customized to specific audiences rather than being duplicated as a search engine optimization (SEO) trick.
Suppose you have a website with pages available in multiple languages, including English and Spanish. To indicate the language and geographical targeting of these pages, you would use hreflang tags in the HTML code of each page.
For the English version of a page, you would include the following hreflang tag in the <head> section of the HTML code:
html
<link rel=”alternate” hreflang=”en” href=”https://example.com/page1″>
For the Spanish version of the same page, you would include the following hreflang tag:
html
<link rel=”alternate” hreflang=”es” href=”https://example.com/page1-es”>
In this example:
By including hreflang tags on your website, you help search engines like Google serve the most relevant language and location-specific versions of your pages to users searching in different languages and regions. This enhances the user experience and can improve your website’s visibility and ranking in search results for international audiences.