Adding HREFLang Link Elements to Global Site Directories

Our testing tool was generating some incorrect errors from large sites that were using the HREFlang in the body of pages to designate different language versions in their country locator. Note, this HREFLang element is NOT the same as the one for Search Engines. This one was designed to help browsers and bots to detect if it should go into specific content types and language types.

“Hat Tip to Adobe Search & AEM Teams for pointing out the error in the testing tool.”

If you do use this ensure your team reads the HREFLang Link specification on W3C as it stipulates that the two letter ISO Language code be used. In the two cases below they are using the incorrect syntax of country and language and incorrect ISO Language codes.

Here is another case where it was baked into the Country Locator that is in a pull down.

I have seen a few of these lately so someone must have given it as a suggestion to webmasters. The HREFLang Element must either be in the response header, the

A secondary problem with this implementation is the incorrect use of country names or countries rather than language elements.

This would actually make a lot of sense as a way to implement. I actually started working on a recommendation for Search Engines to adopt something like this where you can plug it into this page but unfortunately, 99.99999% of sites only send people to the home page vs. to a local page and about 90% of these global locators are not updated.