Search Knowledge Base by Keyword

Table of Contents
< Back
You are here:

Mistake – Using Protocol-Relative URL’s in HREFLang Tags

Protocol-relative (aka Protocol-Neutral) URLs are a URL format that is often used by those leveraging CDNs to allow the browser to pick the security protocol.  The URL or image asset can be called both HTTP and HTTPS.   This is great when you have a mix of secure and non-secure elements on the page that have not been converted.  This allows the browser to show both forms without breaking if one variation is missing.   

Why are Protocol-Relative URLS bad for your HREFLang Implementation?  

The HREFLang element is telling the search engine that the page in the element is the “alternative” of this URL – if I am on the HTTP version of the page then it matches the alternative page’s HTTP version.  However, If Google ALSO encounters the HTTPS version on this page it is also the alternative to that page, causing confusion and duplicating the URL causing Google to ignore these hreflang pairs.

So far, on ALL sites where protocol-relative URLs have been used in the hreflang elements, Google has given the pages a “No Return Tag” error since they cannot correctly map the pages.

What is the fix:  

The easiest fix is to add a full path to your HREFLang Elements.  If you have the HTTPS use that.


Google specifically tells us not to run both HTTP and HTTPS simultaneously and to specifically use a 301 redirect from all http to https pages. This should effectively eliminate the http version of the URL removing the potential for both protocols at a URL level.  You can still use it for all other elements on the page.

Table of Contents