Neova高级 SEO 平台

hreflang 使用相对 URL

在 Neova 中 直接在抓取过程中运行,无需任何设置。

规则最近审核:2026年10月17日 · 指南更新:2026年7月1日

Google 要求 hreflang 中使用包含协议的完整 URL。相对 URL 或协议相对 URL 不符合这一要求。

您可以做什么

把每个 hreflang 的 href 写成完整 URL,开头为 https://.

Neova 如何发现

Neova 对照规则检查服务器对每个地址的响应。

Neova 为何标记

  • Google 要求 hreflang URL 是完整的网址(包括 https://),相对 URL 或省略协议的 URL 都不符合规则。
  • Google 无法使用的标注,会让搜索者看到错误的语言版本。
  • 完整 URL 在页面被复制或从其他主机提供时也依然正确。

来源

生成的工单

这一部分目前只有英文版。

HR-017 · Hreflang Uses a Relative URL

How to Check the Fix: 1. Run the check again in Neova
2. Spot-check sample URLs across affected templates
3. Record the re-check date and period label next to the baseline

Neova writes this ticket for every affected page group and sends it to Jira, Linear, Asana and the rest, after you approve it.

完整指南

这一部分目前只有英文版。

TL;DR: hreflang annotations that point at relative URLs (like /fr/produit instead of https://example.com/fr/produit) are invalid. Google ignores them, so your language and region targeting silently stops working. Every href value in an hreflang cluster must be a fully qualified absolute URL with protocol and host.
Check code
HR-016
Severity
High
Where
head / sitemap / header
Fix effort
Low
Detect with
Screaming Frog

What This Check Is Flagging

hreflang is how you tell Google that a page has equivalent versions in other languages or regions, so the right version gets served to the right searcher. The mechanism is a set of <link rel="alternate" hreflang="xx"> tags (or the sitemap / HTTP header equivalents), and each one carries an href pointing at the alternate URL. This check fires when that href is relative instead of absolute.

An absolute URL is the whole address: scheme, host, path. A relative URL is a fragment that only makes sense in the context of the current page. Browsers resolve relative links against the current document all day long, which is exactly why people assume hreflang will too. It will not. The hreflang spec and Google's own documentation both require the fully qualified form.

Relative (broken) hreflang="fr" href= "/fr/produit" Google cannot resolve host: annotation dropped.

Absolute (valid) hreflang="fr" href= "https://ex.com/fr/produit" Google maps the cluster: correct version served.

Rule: scheme + host + path, every time. No leading-slash paths, no protocol-relative //. https:// example.com /fr/produit

Why It Matters for SEO

When hreflang works, a French searcher lands on the French page and a Canadian searcher lands on the CA page, without you fighting canonical wars or accidentally cannibalizing your own rankings across locales. When the annotations are invalid, none of that happens. Google treats a relative href as unparseable and drops the pairing. Because hreflang is bidirectional and requires every page in the cluster to point at every other page (including itself), one broken href can unravel the whole return-tag relationship for that set.

The failure is quiet, which is what makes it nasty. Nothing errors out, nothing 404s, the page renders fine. You just gradually notice the wrong-language version outranking the right one in a market, or duplicate-content style suppression where two near-identical localized pages compete instead of cooperating. By the time it shows up in revenue it has usually been broken for months.

How to Detect It

  • Screaming Frog SEO Spider: crawl with hreflang extraction on, then open the Hreflang tab. It flags non-absolute URLs and missing return tags directly. This is the fastest way to audit a whole site.
  • Google Search Console: the International Targeting report is deprecated, but the URL Inspection tool still shows how Google parsed a page's alternates. If a relative href was dropped, it will not appear in the detected alternates.
  • Sitebulb: runs a dedicated hreflang audit with a "not absolute URL" hint and a visual cluster map, which is handy for explaining the problem to a stakeholder.
  • View source / server logs: for a spot check, view the raw HTML or the XML Sitemap and eyeball the href values. If any start with /, ./, ../, or //, they are relative or protocol-relative and need fixing.

Common Ways This Creeps In

You Wrote Type Result
/fr/produit Root-relative Invalid, dropped
produit Path-relative Invalid, dropped
//example.com/fr/produit Protocol-relative Not recommended, risky
https://example.com/fr/produit Absolute Valid

How to Fix It, Step by Step

  1. Find the source of the tags. hreflang is almost always generated by a template, a plugin, or a sitemap builder, not hand-authored per page. Fix it at the source and you fix every page at once.
  2. Emit the full URL. Prepend the canonical scheme and host to whatever path your code produces. In practice that means concatenating https://yourdomain.com with the localized path, using the same casing and trailing-slash convention as your canonical tags.
  3. Match your canonical exactly. The hreflang href for a page should be byte-identical to that page's self-canonical: same protocol, same host (www or not), same trailing slash. Mismatches here create a second, separate class of hreflang bug.
  4. Do not use protocol-relative //. It technically has a host but Google's guidance is to specify the protocol. Pick https:// and commit.
  5. Re-crawl and confirm. Run Screaming Frog again and check the Hreflang tab shows zero non-absolute URLs and complete return tags before you call it done.

What "Good" Looks Like

Every href in every hreflang annotation is a complete https://host/path string. Each URL in the cluster lists all the others plus itself, and each of those references is absolute and matches the target page's canonical. A crawl comes back clean with no "not absolute" and no "missing return tag" warnings. Served to the right searcher, the right localized page wins.

Do

  • Use full https://host/path URLs in every hreflang href
  • Fix at the template or plugin so all pages inherit the fix
  • Keep hreflang hrefs identical to each page's self-canonical
  • Re-crawl in Screaming Frog to confirm zero non-absolute warnings
  • Include a self-referencing hreflang for each page

Don't

  • Ship root-relative /fr/page or path-relative hrefs
  • Use protocol-relative //host/path and hope it resolves
  • Assume browsers resolving relative links means Google will too
  • Mix www and non-www between hreflang and canonical
  • Leave one page's cluster half-fixed: it breaks the return tags

FAQ

Does This Apply to Hreflang in XML Sitemaps Too?
Yes. Whether your hreflang lives in the HTML head, the HTTP header, or the XML Sitemap, the href always has to be an absolute URL. Sitemaps are actually a common offender because people template the loc and the alternate paths separately and forget the host on one of them.
Will Google Show an Error If My Hreflang Is Relative?
Not loudly. The old International Targeting report is gone, so the annotation just gets silently ignored. That is why a crawler like Screaming Frog or Sitebulb is your early warning system rather than Search Console.
Is Protocol-Relative //example.com/ Acceptable?
It is not recommended. Google's documentation asks for the full URL including the protocol. Use https:// explicitly and avoid the ambiguity entirely.
One Page Had a Relative href but the Rest Are Fine. Is That a Real Problem?
Yes, because hreflang is a cluster. If page A points at page B with a broken href, the return-tag relationship for that pair fails and can weaken confidence in the whole set. Fix every href, not just most of them.

International Setup Gone Quiet?

If the wrong-language version keeps outranking the right one, the hreflang cluster is usually the culprit. Our team audits the whole return-tag graph and hands you a fix list.

在您自己的网站上找到它

Neova 在每次抓取时都会运行此检查项和其他所有检查项,然后把修复方法写成工单交给您的团队。

  • 适用于 Mac、Windows 和 Linux 的桌面应用
  • 全部 696 项检查,每项都附来源
  • Search Console 和 Analytics 4,以只读方式连接
  • 工单发送到 Jira、Linear 和 Asana

下载 Neova Desktop Free 套餐,或免费试用 Solo 14 天,无需银行卡。

全部国际 SEO 检查 · 指南 · 检查项库

作者:Neova Labs · 返回检查项库