You can also set referrer policies inside HTML. For example, you can set the referrer policy for the entire document with a <meta>
element with a name of referrer
:
<meta name="referrer" content="origin" />
You can specify the referrerpolicy
attribute on <a>
, <area>
, <img>
, <iframe>
, <script>
, or <link>
elements to set referrer policies for individual requests:
<a href="http://example.com" referrerpolicy="origin">…</a>
Alternatively, you can set a noreferrer
link relation on an a
, area
, or link
elements:
<a href="http://example.com" rel="noreferrer">…</a>
Warning: As seen above, the noreferrer
link relation is written without a dash. When you specify the referrer policy for the entire document with a <meta>
element, it should be written with a dash: <meta name="referrer" content="no-referrer">
.