Neova高级 SEO 平台

Referrer-Policy 设置为 unsafe-url

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

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

使用 unsafe-url 时,浏览器会把完整的 URL(包括路径和查询字符串)发送给其他网站。MDN 提醒这会泄露隐私信息。缺少该响应头不会被标记,因为浏览器此时会使用 strict-origin-when-cross-origin。

您可以做什么

把 Referrer-Policy 设置为 strict-origin-when-cross-origin,或从响应头和 meta referrer 标签中删除 unsafe-url。

Neova 为何标记

  • 使用 unsafe-url 时,浏览器会把完整的 URL(包括路径和查询字符串)发送给页面链接或加载资源的每个网站。
  • 查询字符串可能包含搜索词、会话 ID 或个人数据,MDN 警告这一策略会泄露它们。
  • 没有任何策略时,浏览器默认使用 strict-origin-when-cross-origin,只向其他网站发送来源。

来源

完整指南

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

TL;DR

Add a Referrer-Policy: strict-origin-when-cross-origin response header so your site controls how much URL data browsers leak to other sites while still preserving clean referral attribution in analytics.

What the Referrer-Policy Header Is

When a browser follows a link, loads an image, or fetches a script from one page to another, it can attach a Referer request header (the historical misspelling is baked into the spec) that tells the destination which URL the request came from. The Referrer-Policy response header is how your server tells the browser exactly how much of that originating URL to share: the full address, the origin only, or nothing at all.

When the header is missing, the browser falls back to its own built-in default. In modern browsers that default is strict-origin-when-cross-origin, which is reasonable, but relying on an implicit default means behavior can differ across browsers and versions, and you have no documented, intentional policy of your own. Setting the header explicitly removes that ambiguity.

Why It Matters

Privacy and Security

URLs frequently carry information you would not want broadcast to third parties: session tokens in query strings, internal path structures, password-reset identifiers, account IDs, or search terms. Without a policy, that full URL can be sent in the Referer header to every external resource and outbound link. OWASP flags this as a real data-leak vector and recommends always setting a Referrer-Policy so sensitive information in URLs is not exposed to destinations you do not control.

Analytics and Referral Data

This is the part that catches SEO and marketing teams off guard. The Referer header is exactly what powers referral attribution. When another site links to you, your analytics platform reads that header to credit the visit to its source. If you (or sites linking to you) apply an overly strict policy such as no-referrer, those visits can show up as direct traffic instead of being attributed to the referring domain, and your inbound-link reporting goes dark.

The reverse matters too: if your own site sends no-referrer, the partners, publishers, and affiliates you link out to lose the ability to credit you as a traffic source, which can quietly weaken relationships and reporting. The goal is a balanced policy that protects sensitive data without erasing legitimate attribution.

SEO Impact

The header is not a ranking factor and Google does not use it to score pages. Its SEO relevance is indirect: site auditors such as Screaming Frog and Sitebulb report a missing Referrer-Policy as a security or best-practice issue, so it shows up on technical-audit scorecards. Clearing it improves your audit hygiene and protects the referral data that underpins your off-page reporting.

Policy Values Explained

The values range from sending everything to sending nothing:

no-referrer sends no Referer header at all. Maximum privacy, but it erases all referral attribution. Breaks analytics referral tracking.
no-referrer-when-downgrade sends the full URL except when moving from HTTPS to HTTP. This was an old default and is no longer recommended because it leaks full paths between secure sites.
origin sends only the origin (scheme plus host), never the path or query.
origin-when-cross-origin sends the full URL to same-origin destinations and only the origin to cross-origin ones.
same-origin sends the full URL within your own site and nothing to other sites.
strict-origin sends only the origin, and nothing when downgrading HTTPS to HTTP.
strict-origin-when-cross-origin sends the full URL to same-origin requests, only the origin to cross-origin requests at the same security level, and nothing on a downgrade. This is the modern browser default and the recommended balance.
unsafe-url always sends the full URL, including on downgrades. Avoid: it leaks paths and query strings everywhere.

How to Diagnose

Check the response headers your server actually sends. From a terminal:

curl -sI https://example.com/ | grep -i referrer-policy

No output means the header is absent. You can also open your browser DevTools, go to the Network tab, click the document request, and read the Response Headers. Site crawlers like Screaming Frog (Security tab) and Sitebulb will list every URL that is missing the header in a single report.

How to Fix

Apache (.htaccess or Vhost)

<IfModule mod_headers.c>
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

Nginx

add_header Referrer-Policy "strict-origin-when-cross-origin" always;

Place this inside the relevant server or location block, then reload with nginx -s reload.

WordPress (functions.php)

add_action('send_headers', function () {
    header('Referrer-Policy: strict-origin-when-cross-origin');
});

A security plugin such as a headers manager can set the same value through a settings screen if you prefer not to edit code.

Meta-Tag Fallback

If you cannot touch server configuration, add this to the <head>. The response header is preferred because it covers every resource, but the meta tag works for the document:

<meta name="referrer" content="strict-origin-when-cross-origin">

For most sites, set strict-origin-when-cross-origin. It withholds full paths and query strings from external destinations, never leaks anything on an HTTPS-to-HTTP downgrade, and still passes your origin to other sites so referral attribution keeps working in their and your analytics. Reserve no-referrer for pages with genuinely sensitive URLs, and only after you have accepted that it will suppress referral reporting.

Q: Will adding this header hurt my Google rankings?

A: No. It is not a ranking signal. It only affects what referrer data browsers share and clears a security best-practice flag in technical audits.

Q: Will it break my analytics referral tracking?

A: Not with the recommended value. strict-origin-when-cross-origin still sends your origin to other sites, so referral attribution continues to work. Only no-referrer would suppress it.

Q: Header or meta tag, which should I use?

A: Prefer the response header. It applies to every request including images, scripts, and fonts. The meta tag is a fine fallback when you only have access to page HTML.

Need a full technical audit?

Neova runs deep crawls that catch issues like this across your whole site.

在您自己的网站上找到它

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

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

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

全部安全检查 · 指南 · 检查项库

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