'Does the hreflang attribute follow different language-code rules in `<link ref="alternate">` and `<a>`?

Does the hreflang attribute follow different language-code rules in <link ref="alternate"> and <a>?

For instance:

  1. <link rel="alternate" href="https://example.cn/" hreflang="zh-Hans" />
  2. <a href="https://example.tw" hreflang="zh-Hant">Some Link</a> *
  3. <link rel="alternate" href="https://example.cn/" hreflang="zh-TW" /> *
  4. <a href="https://example.tw" hreflang="zh-TW">Some Link</a>

The #2 rule got a warning from a seo related website.

The #3 will get a warning from Google search console.

zh-Hant and zh-TW are different standards.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source