Referrer-Policy: what each of the eight values actually leaks
This Referrer-Policy generator shows exactly what every policy value hands to a third party, using your own sample URL, then produces the header with server config for six platforms. Below: what the Referer header carries, which value to choose, and why it must never be trusted.
What the header carries
When a browser follows a link, loads an image, or fetches a script, it may include a Referer header naming the page that triggered the request. Depending on policy, that is either nothing, your origin, or the complete URL.
The complete URL is the problem. Consider https://example.com/account/orders?id=48213&token=s3cr3t. Under a permissive policy, every third-party resource on that page — the font CDN, the analytics beacon, the ad pixel, the embedded map — receives that entire string, token included, in their access logs.
This is not hypothetical. Password reset links, document-sharing URLs, internal search queries and invoice identifiers have all leaked to third parties this way, and the sites involved rarely realised until much later.
The eight values
| Value | Same-origin | Cross-origin | HTTPS→HTTP |
|---|---|---|---|
no-referrer | nothing | nothing | nothing |
no-referrer-when-downgrade | full URL | full URL | nothing |
origin | origin | origin | origin |
origin-when-cross-origin | full URL | origin | origin |
same-origin | full URL | nothing | nothing |
strict-origin | origin | origin | nothing |
strict-origin-when-cross-origin | full URL | origin | nothing |
unsafe-url | full URL | full URL | full URL |
unsafe-url is the only value the specification names as unsafe, and it earns it: the full URL travels to every destination including over plaintext HTTP. There is essentially no legitimate reason to choose it.Two patterns explain the whole table. strict- means "send nothing on a downgrade to HTTP". -when-cross-origin means "full URL internally, less to outsiders".
Which to choose
strict-origin-when-cross-origin
The default in every current browser and the right answer for most sites. Keeps full URLs internal, gives third parties only your origin, leaks nothing over plaintext.
strict-origin
When even your own pages do not need path-level referrers. Slightly tighter, at the cost of internal analytics detail.
same-origin
When no third party should learn anything at all. Strong privacy; removes your traffic from partners' referral reports entirely.
no-referrer
Maximum privacy. Appropriate for health, legal, financial and internal tools where even your hostname is sensitive.
The three non-strict legacy values — origin, origin-when-cross-origin, no-referrer-when-downgrade — differ from better alternatives only by leaking on a downgrade. Prefer the strict- version in each case.
The analytics trade-off
Tightening this header has a measurable cost, and it lands on other people as much as on you.
- Origin-level policies keep the referring site visible but lose the referring page. Most analytics tools handle this fine — it is what they already receive from most traffic.
same-originandno-referrermean partners see your traffic as direct. Affiliate programmes that attribute by referrer will not credit you.- Your own inbound reporting is unaffected. This header governs what you send outward, not what other sites send to you.
- Internal funnels stay intact under any
-when-cross-originvalue, since same-origin navigation still carries the full URL.
referrerpolicy on that anchor. Narrow exceptions beat a loose default.Per-element overrides
The header sets a document-wide default. Individual elements can be tightened or loosened, and the narrowest declaration wins:
- On a link
<a href="…" referrerpolicy="no-referrer">for outbound links to sites you would rather not inform. - With rel
rel="noreferrer"is the older shorthand and also impliesnoopener, which is worth having on untrusted links anyway. - On subresources
referrerpolicyworks on<img>,<script>,<link>and<iframe>. - In JavaScript
fetch(url, { referrerPolicy: "origin" })controls a single request. - PrecedenceElement beats document meta, which beats the header.
Never trust a referrer
The value arrives from the client, which means it is a claim rather than a fact. It can be omitted entirely, set to anything by a non-browser client, stripped by privacy tooling or a corporate proxy, and suppressed by the sending site's own policy.
Any control that depends on it is broken by construction. That includes referrer-based CSRF defence, hotlink protection treated as security rather than as bandwidth management, and "you must have come from page X" gating. Use tokens for CSRF, authentication for access control, and treat the referrer purely as an analytics signal.
Related security headers
- Content Security Policy Generator — the header that stops XSS.
- Permissions-Policy Generator — disable camera, location and sensors.
- security.txt Generator — publish a disclosure contact.
- X-Robots-Tag Generator — indexing headers for files.
- .htaccess Redirect Generator — Apache header and redirect config.