HTML Referrer Policies and Link Privacy
Set policy for an individual link
The Referer HTTP request header (historical spelling) can disclose information about the referring page. referrerpolicy="no-referrer" requests that no referrer be sent for this link. The example checks the declared policy without following the link.
<a href="https://example.org/help" referrerpolicy="no-referrer">External help</a>The link reflects no-referrer.
Choose the document default
The usual modern default strict-origin-when-cross-origin sends a full eligible referrer URL for same-origin requests, only the origin for cross-origin requests without security downgrade, and none for HTTPS to HTTP. A meta referrer declaration sets a document policy; the HTTP response header is preferable for server-wide consistency.
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="referrer" content="strict-origin-when-cross-origin"> <title>Policy</title> </head> <body> <p>Policy example</p> </body></html>The head declares the policy.
Separate referrer privacy and opener isolation
rel="noreferrer" prevents referrer disclosure for the link and implies noopener behavior. noopener alone prevents the new browsing context from obtaining an opener reference but does not suppress the referrer. Neither hides the destination from the browser or guarantees anonymity.
<a href="https://example.org/guide" target="_blank" rel="noopener noreferrer">External guide</a>Both relationship tokens are present.
Common mistakes and practice
Do not store secrets in URLs, even with a restrictive referrer policy: history, logs and destination requests can still expose them. Test actual request headers using controlled origins when deploying.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Referrer Policies and Link Privacy — Knowledge Check
Apply the security, privacy and performance concepts taught in this lesson.
What is the header spelling?
What does no-referrer suppress?
Under the usual strict-origin-when-cross-origin policy, what goes to an HTTPS cross-origin destination?
What does noreferrer imply?
Does a restrictive policy make URL secrets safe?