Google updated their hreflang documentation to note a quirk in how some websites are using it which (presumably) can lead to unintended consequences with how Google processes it.
hreflang Link Tag Attributes
is an HTML attribute that can be used to communicate data to the browser and search engines about linked resources relevant to the webpage. There are multiple kinds of data that can be linked to such as CSS, JS, favicons and hreflang data.In the case of the hreflang attribute (attribute of the link element), the purpose is to specify the languages. All of the link elements belong in the
section of the document.
Quirk In hreflang
Google noticed that there is an unintended behavior that happens when publishers combine multiple in attributes in one link element so they updated the hreflang documentation to make this more broadly known.
The changelog explains:
“Clarifying link tag attributes
What: Clarified in our hreflang documentation that link tags for denoting alternate versions of a page must not be combined in a single link tag.Why: While debugging a report from a site owner we noticed we don’t have this quirk documented.”
What Changed In The Documentation
There was one change to the documentation that warns publishers and SEOs to watch out for this issue. Those who audit websites should take notice of this.
This is the old version of the documentation:
“Put your tags near the top of the
element. At minimum, the tags must be inside a well-formed section, or before any items that might cause the to be closed prematurely, such as
or a tracking pixel. If in doubt, paste code from your rendered page into an HTML validator to ensure that the links are inside the
element.”
This is the newly updated version:
“The tags must be inside a well-formed
section of the HTML. If in doubt, paste code from your rendered page into an HTML validator to ensure that the links are inside the element. Additionally, don’t combine link tags for alternate representations of the document; for example don’t combine hreflang annotations with other attributes such as media in a single tag.”
Google’s documentation didn’t say what the consequence of the quirk is but if Google was debugging it then that means it did cause some kind of issue. It’s a seemingly minor thing that could have an outsized impact.
Read the newly updated documentation here:
Tell Google about localized versions of your page
Featured Image by Shutterstock/Mix and Match Studio