What is the difference between HTML lang attribute and LINK hreflink attribute?

What is the difference between HTML lang attribute and LINK hreflink attribute? - Google Search Console is a free application that allows you to identify, troubleshoot, and resolve any issues that Google may encounter as it crawls and attempts to index your website in search results. If you’re not the most technical person in the world, some of the errors you’re likely to encounter there may leave you scratching your head. We wanted to make it a bit easier, so we put together this handy set of tips about seo, google-search, local-seo, multilingual to guide you along the way. Read the discuss below, we share some tips to fix the issue about What is the difference between HTML lang attribute and LINK hreflink attribute?.Problem :


Let say example.com has two different country version apart from main English version




  1. Israel(example.il)

  2. New Zealand(example.nz)



What SEO practice should I follow.



Method 1 - HTML lang



example.com
<html lang="en">
example.il
<html lang="he-IL">
example.nz
<html lang="en-NZ">


Method 2 - HTML hreflang link
inside head tag
example.com



<head>
<link rel="alternate" href="http://example.com/"
hreflang="en" />
<link rel="alternate" href="http://example.il/"
hreflang="he-IL" />
<link rel="alternate" href="http://example.nz/"
hreflang="en-NZ" />
</head>


similarly use the same for other pages(example.il,example.nz).



Google says from 2011 they started treating link with hreflang for mentioning language specific content.
Now Which method should I use to make the site language and country specific when it comes to search engines?



What is the difference between <html lang> and <link hreflang> ?


Solution :


Which method should I use ...


What is the difference between <html lang> and <link hreflang>.



You can use both.


The lang attribute on the html tag informs user-agents the language of the current document.


The hreflang attribute informs user-agents/bots of the location of alternative localised versions of the current document.


In a way they are complementary.


However, Google most probably ignores the lang attribute and auto-detects the document language instead. I believe Google ignores all language identifiers, except for hreflang.


hreflang on the other hand is recommended by Google to help indexing of multi-lingual websites. So, if you needed to choose one or the other then the hreflang would be the one to go for.


If the issue about seo, google-search, local-seo, multilingual is resolved, there’s a good chance that your content will get indexed and you’ll start to show up in Google search results. This means a greater chance to drive organic search traffic to your site.

Comments

Popular posts from this blog

Is it possible to outrank Google for a search term on their own search engine?

Removing a Website Name in Another Website From Google Index

Do search engines index a rich snippet data from HTML which is not visible?