Security & Privacy

referrerpolicy="origin-when-cross-origin"

Sends the full referrer URL for same-origin requests and just the origin for cross-origin requests. Unlike the strict variant, it does not suppress origin on downgrade. On relevant request-generating elements such as a, area, img, iframe, link and script. An omitted or empty policy uses the applicable inherited/default policy. The referrer never includes credentials or fragments. The example requires real navigation and server logs to inspect headers.

Formal Syntax & Structure

html syntaxhtml
referrerpolicy="origin-when-cross-origin"

Parameters & Attributes

NameTypeDescription
referrerpolicykeywordSends the full referrer URL for same-origin requests and just the origin for cross-origin requests. Unlike the strict variant, it does not suppress origin on downgrade.

Working Example

Example Snippethtml
<a href="https://example.com/" referrerpolicy="origin-when-cross-origin">External resource</a>
HTML Reference