Defaults.Exposed

Defaults.ExposedFixes › Referrer-Policy

How to fix Referrer-Policy

A Referrer-Policy is a one-line instruction your website hands to every visitor's browser, controlling how much of your web address travels with them when they click a link to another site. Without it, the full address of whatever page they were on — search terms, account numbers, reset links, internal page paths and all — is quietly handed to the next site they land on, including advertisers, analytics firms, and anywhere else a link points.

Bottom line for your business: Every time a visitor clicks an outbound link, ad, or shared resource, their browser can hand the full address of your page to the destination — and if your addresses carry search queries, customer IDs, order numbers, or one-time links, you are leaking customer data to third parties you do not control. That is a data-protection problem regulators take seriously, a privacy promise quietly broken, and a graded gap a client's security team will flag during due diligence.

What this can cost you

Why it matters. Browsers, left to their own devices, are chatty: by default they tell the next website where a visitor just came from, often including the full address of the page. For a brochure site that may be harmless, but the moment your addresses contain anything personal — a search term, an order ID, an email in a link, a private path — that default quietly leaks it to outside parties. A Referrer-Policy is the single setting that tells browsers to stop oversharing. It is a graded check on your scorecard worth real points, it maps directly to data-minimisation duties under privacy law, and it is one of the standard security headers any professional review expects to find.

What this is, in plain words

Every time a visitor on your website clicks a link to another site — an outbound link, a banner ad, a “share this”, even a font or image loaded from elsewhere — their browser quietly attaches a note saying which page of yours they came from. That note is called the referrer.

Used sensibly, the referrer is harmless and even helpful: it is how other sites know that traffic came from you, and it powers a lot of honest analytics. The catch is in the default behaviour. Left unmanaged, the browser does not just say “they came from your-business.com” — it often hands over the full address of the exact page, including everything after the domain name. And web addresses carry far more than people realise: search terms typed into your site, order and account numbers, the path to a private members-only page, even one-time secret tokens in password-reset and confirmation links.

A Referrer-Policy is a single instruction your website sends to the browser that says how much of that note it is allowed to share. You can tell it to share only your domain name, only to other pages on your own site, or nothing at all. Think of it as the difference between handing a stranger your full home address with your daily schedule attached, versus just telling them which town you live in.

This is one of a small family of “security headers” — short instructions your site gives every visitor’s browser. It does not change how your site looks or works. It simply stops the browser from oversharing on your behalf.

What this can cost you

Here are concrete, everyday ways a missing or permissive Referrer-Policy bites real businesses. None of these require a hacker — they happen automatically, every day, in normal use.

What it actually is

By default, browsers follow a behaviour roughly equivalent to “strict-origin-when-cross-origin” on modern versions — but you cannot rely on that, because older browsers, embedded webviews, and certain configurations still fall back to leaking more. The only way to be sure is to set the policy explicitly. When you do, you are choosing one rule from a short list. The ones that matter:

And the two values to avoid, because the scorecard treats them as no better than having no header at all:

What “good” looks like: a Referrer-Policy header is present and set to a restrictive value — for most businesses, strict-origin-when-cross-origin. This keeps referral analytics working while ensuring nothing past your domain name ever reaches an outside site.

How to fix it (free, about 5 minutes)

Hand this section to your IT person, web developer, or hosting support — the fix is free, it is a single line, and it will not break your site. There is no risky rollout here: unlike some security settings, a sensible Referrer-Policy cannot stop your links or pages from working. It only trims what gets shared with other sites.

The goal: set a Referrer-Policy response header with the value strict-origin-when-cross-origin (or a stricter value if you prefer to share even less).

Cloudflare (no code — easiest if you use it): Dashboard → your domain → Rules → Transform Rules → Modify Response Header → Create rule → Set static → Header name Referrer-Policy, value strict-origin-when-cross-origin → apply to all incoming requests → Deploy.

Google Workspace / Microsoft 365: these manage your email, not your website, so the header is set wherever your site is actually hosted (your web host, CDN, or server) — not in Workspace or 365 admin. Identify the host and use the matching option below.

Nginx:

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

Apache (in the site config or .htaccess):

Header always set Referrer-Policy "strict-origin-when-cross-origin"

IIS (web.config):

<httpProtocol><customHeaders>
  <add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
</customHeaders></httpProtocol>

Node / Express:

app.use((req, res, next) => { res.setHeader('Referrer-Policy', 'strict-origin-when-cross-origin'); next(); });

WordPress / common hosts: most managed WordPress and shared hosts let you add response headers either through a security plugin, a “headers” panel in the hosting control panel, or the .htaccess snippet above. If you are behind Cloudflare, the Cloudflare method is the cleanest and applies everywhere at once.

After applying: load your site and re-run the check, or use your browser’s developer tools (Network tab → click the main document → Response Headers) to confirm Referrer-Policy: strict-origin-when-cross-origin is present.

Common mistakes

Referrer-Policy sits alongside a small set of other web security headers we check — Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, and a few advanced cross-origin headers. They protect different things, so having one does not cover the others. If your Referrer-Policy is missing, it is worth asking whoever fixes it to confirm the other standard headers are in place at the same time, since they are typically configured in the same one place and the visit costs nothing extra.

In short

Referrer-Policy is the cheapest, safest privacy fix on your scorecard: one line, about five minutes, no risk of breaking anything, and free. It stops your visitors’ browsers from quietly handing your private page addresses — and whatever personal data they contain — to every outside site they click through to. Set it to strict-origin-when-cross-origin, confirm it is live on every page, and the medium-severity gap and its 15 points are closed.

FAQ

I'm not technical — is this something I can actually deal with?

Yes, and it is one of the easiest fixes on the whole scorecard. It is a single line added by whoever runs your website or hosting, and on services like Cloudflare it is a couple of clicks with no code at all. Hand them the 'How to fix it' section below. It is free, it takes about five minutes, and unlike some security settings it will not break anything on your site.

What does 'referrer' even mean here?

When someone clicks a link from your page to another website, their browser sends along a note saying which page they came from — that note is called the referrer. It is genuinely useful for honest analytics. The problem is that, by default, the note often includes your full page address, not just your domain name. If that address contains anything private, it gets shared too. A Referrer-Policy lets you trim the note down to just your domain, or switch it off, so nothing sensitive leaks.

Is this really worth bothering with if my site doesn't handle payments?

Almost certainly yes. You do not need a checkout to have private information in your web addresses — search boxes, contact forms, account pages, document links, and password-reset emails all routinely put data in the address bar. And even with no personal data at all, leaking your internal page paths to every outside site your visitors click hands competitors and scrapers a free map of your site. The fix costs nothing and five minutes, so there is little reason to skip it.

Could turning this on break my site or my analytics?

No. This is one of the safe headers — it only controls how much address detail is shared with other sites, not whether links work. The recommended setting still sends your domain name to outside sites, so legitimate referral analytics keep working; it just stops the full private address from going with it. There is no watch-only trial needed and nothing to test on staging first.

Is this a privacy-law issue or just a nice-to-have?

It can be a genuine compliance issue. Data-protection rules require you to collect and share only the minimum personal data needed, and to know who your data goes to. If your addresses carry personal identifiers and you leak them to advertisers or analytics firms with no agreement in place, that is a data-minimisation failure auditors and regulators recognise. For most businesses this header is a cheap, concrete way to close that gap.

Does this affect our grade, or is it just advice?

It affects your grade. The Referrer-Policy check is graded and worth up to 15 points in the Web Security category. A missing header is marked medium severity. Note one trap: setting the header to a permissive value such as 'unsafe-url' or 'no-referrer-when-downgrade' scores zero — the same as having no header at all — because those values still leak the full address. To earn the points you need a properly restrictive value like 'strict-origin-when-cross-origin'.