Relative URLs may be misinterpreted by search engines, so it’s recommended they are fully qualified URLs as part of your hreflang tag.
Google offers the following example of valid vs. invalid hrefs:
A qualified URL includes the hypertext transfer protocol (i.e. http) and the full domain. And so, it provides all the information of that specific URL, instead of just parts of it. Hence its alternate name, absolute!
If your URLs are relative, you can update them to be absolute. Here’s how.
Relative URLs can be misinterpreted by Googlebot, so they might not be indexed. This would cancel out the benefit of adding hreflang.
As for your absolute URLs, they are fully qualified, so Googlebot is less likely to misinterpret them. Remember, an absolute URL includes all relevant information, even the transport method (i.e. http or https).
Changing the URL used in your hreflang tag requires updating the href attribute. There’s no need to add or delete any elements to resolve this issue. The update here involves filling in the pieces of the URL that are missing.
If the URL used in your hreflang only includes the domain and path (i.e. //example.com/foo) or just the specific subfolder (i.e. /foo) you’ll want to update these relative URLs to be absolute.
Here’s what an absolute URL would look like:
https://example.com/foo
The country and language code of your hreflang tag can stay the same, this issue only rests with the URL.
Since hreflang is a part of your site’s code, you’ll need backend access to make the change. If you don’t have these access permissions, the dev team should be able to help you out.
Diving directly into your site’s code is one way to change your hreflang URLs from relative to absolute. However, this solution operates on a page-by-page basis.
To make mass changes across your site, you can leverage SEO execution platform ClarityAutomate. With this approach, a few clicks is all it takes to update your hreflang across thousands of pages. Here’s how.
This href grew from: /playbook/hreflang_rel_links.html"
To this: https://seoautomation.io/playbook/hreflang_rel_links.html"