<meta name="referrer"> HTML attribute value

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

The referrer value for the name attribute of the <meta> element controls the HTTP Referer header of requests sent from the document. If specified, you define the referrer using a content attribute in the <meta> element as a keyword value.

For example, the following <meta> element sends the origin of the document as the referrer:

html
<meta name="referrer" content="origin" />

Warning: Dynamically inserting <meta name="referrer"> (with document.write() or appendChild()) makes the referrer behavior unpredictable. When several conflicting policies are defined, the no-referrer policy is applied.

Usage notes

A <meta name="referrer"> element has the following additional attributes:

content

Sets the document referrer. You must define this attribute. Accepts one of the following values:

no-referrer

Does not send an HTTP Referer header.

origin

Sends the origin of the document.

no-referrer-when-downgrade

Sends the full URL when the destination is at least as secure as the current page (HTTP(S)→HTTPS), but sends no referrer when it's less secure (HTTPS→HTTP). This is the default behavior.

origin-when-cross-origin

Sends the full URL (stripped of parameters) for same-origin requests, but only sends the origin for other cases.

same-origin

Sends the full URL (stripped of parameters) for same-origin requests. Cross-origin requests will contain no referrer header.

strict-origin

Sends the origin when the destination is at least as secure as the current page (HTTP(S)→HTTPS), but sends no referrer when it's less secure (HTTPS→HTTP).

strict-origin-when-cross-origin

Sends the full URL (stripped of parameters) for same-origin requests. Sends the origin when the destination is at least as secure as the current page (HTTP(S)→HTTPS). Otherwise, sends no referrer.

unsafe-URL

Sends the full URL (stripped of parameters) for same-origin or cross-origin requests.

Examples

Removing a referrer from requests

The following <meta> element specifies that the document shouldn't send a Referer header with HTTP requests from the document:

html
<meta name="referrer" content="no-referrer" />

Specifications

Specification
HTML
# meta-referrer

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
referrer
Chrome – Full support
Chrome 17 (Release date: 2012-02-08)
footnote
footnote Until Chrome 46, content values weren't constrained to the values listed in the spec.
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 36 (Release date: 2015-02-24)
footnote
footnote The referrer value wasn't taken into account when navigation was happening via the context menu or middle click until Firefox 39.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote
footnote Until Opera 33, content values weren't constrained to the values listed in the spec.
Safari – Full support
Safari 11.1 (Release date: 2018-04-12)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote
footnote Until Chrome Android 46, content values weren't constrained to the values listed in the spec.
Firefox for Android – Full support
Firefox for Android 36 (Release date: 2015-02-27)
footnote
footnote The referrer value wasn't taken into account when navigation was happening via the context menu or middle click until Firefox for Android 39.
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote
footnote Until Opera Android 33, content values weren't constrained to the values listed in the spec.
Safari on iOS – Full support
Safari on iOS 12 (Release date: 2018-09-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote
footnote Until Samsung Internet 5.0, content values weren't constrained to the values listed in the spec.
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote
footnote Until WebView Android 46, content values weren't constrained to the values listed in the spec.
WebView on iOS – Full support
WebView on iOS 12 (Release date: 2018-09-17)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

See also