Referrer-Policy: Secure Navigation
Referrer-Policy is a security feature that controls how much information about a page's referral source is shared with other websites. This policy helps protect user privacy and prevent malicious activities.
Also available in: УкраїнськаPolski

On this page
The Referrer-Policy is a security feature that controls how much information about a page's referral source is shared with other websites. This policy helps protect user privacy and prevent malicious activities.
What is Referrer-Policy?
Referrer-Policy is an HTTP header that determines which referrer information is sent along with requests. It can be set to control the amount of referrer data shared, from none to full URLs. This feature is crucial in preventing attacks like cross-site request forgery (CSRF) and protecting sensitive user data.
How Referrer-Policy Works
When a user navigates from one website to another, the browser sends referrer information, which includes the URL of the referring page. This information can be used for analytics, logging, and other purposes. However, it can also pose a security risk if sensitive data is included in the referrer URL.
Types of Referrer Policies
There are several types of referrer policies that can be implemented, including no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, and unsafe-url. Each policy determines how much referrer information is sent with each request. The default policy behavior varies depending on the browser and context. For example, some browsers may send referrer information by default, while others may not. It's essential to understand how different browsers handle referrer information to configure the Referrer-Policy header effectively.
Referrer Policy Best Practices
To ensure secure navigation, it's essential to follow best practices when implementing Referrer-Policy.
Implementing Referrer-Policy
Setting the Referrer-Policy is crucial to control the amount of referrer information sent to other sites. Common use cases include setting the policy to "same-origin" to prevent referrer information from being sent to external sites or "no-referrer" to prevent any referrer information from being sent.
When setting the policy, avoid pitfalls such as not testing the configuration thoroughly, which can lead to unintended consequences. To test your site's Referrer-Policy configuration, you can use the browser's developer tools or an uptime monitoring tool to verify that the policy is correctly implemented.
Configuring Referrer-Policy: Step-by-Step
To configure Referrer-Policy, you can use HTTP headers or meta tags. Using HTTP headers is the recommended approach, as it provides more robust security. You can set the Referrer-Policy header in your server configuration or through a Content Security Policy (CSP) directive.
To set the Referrer-Policy using HTTP headers, add the Referrer-Policy directive to your server's configuration file. For example, to set the policy to same-origin, you would add the following line: Referrer-Policy: same-origin.
Alternatively, you can use a meta tag to set the Referrer-Policy. Add the following line to the head of your HTML document: <meta name="referrer" content="same-origin">.
Common Referrer-Policy Scenarios
When implementing Referrer-Policy, consider how it affects various aspects of your online presence. For instance, when sharing content on social media, a strict Referrer-Policy might prevent the social media platform from knowing where the traffic comes from, potentially limiting the analytics available to you.
Impact on SEO
In the context of search engine optimization (SEO), Referrer-Policy can influence how search engines understand the structure and relationships between websites. For affiliate marketing, setting an appropriate Referrer-Policy ensures that referrals are properly tracked without compromising security. To understand how your Referrer-Policy settings impact your SEO efforts, you can analyze your website's traffic patterns and adjust your policy accordingly.
Troubleshooting Referrer-Policy Issues
When implementing Referrer-Policy, issues can arise from policy conflicts or incorrect configuration. Identifying these problems is crucial for maintaining secure navigation. Start by checking for policy conflicts between different security headers, as they can override each other. For instance, a strict Referrer-Policy might be overridden by a less strict Content Security Policy (CSP) directive.
Debugging Referrer-Policy
To debug Referrer-Policy issues, you can use the browser's developer tools to analyze the HTTP headers and meta tags sent by your website. By analyzing the report, you can pinpoint common errors such as incorrect policy values or missing directives.
Conclusion
Implementing a proper Referrer-Policy is crucial for securing navigation and protecting user privacy. Key points to remember include understanding how Referrer-Policy works, following best practices, and configuring it correctly. By doing so, you can prevent unnecessary referrer information from being shared with third-party sites, reducing the risk of sensitive data exposure.
To ensure your website's Referrer-Policy is properly set up, you can use the following checklist:
- Set the Referrer-Policy header to the desired value (e.g.,
same-originorno-referrer) - Test your site's Referrer-Policy configuration using the browser's developer tools or an uptime monitoring tool
- Analyze your website's traffic patterns to understand how your Referrer-Policy settings impact your SEO efforts
- Regularly review and update your Referrer-Policy to ensure it remains effective and aligned with your website's evolving security needs.
For more information on Referrer-Policy and other security headers, you can visit the developer.mozilla.org website.
Frequently asked questions
What is Referrer-Policy?
What are the types of referrer policies?
How does Referrer-Policy work?
What are the best practices for implementing Referrer-Policy?
How do I configure Referrer-Policy?
What is the impact of Referrer-Policy on SEO?
Written and reviewed by
The team that builds AutomioHQ's audit, monitoring and AI tools. We write practical guides grounded in how these checks behave on real websites, verify technical claims against primary sources and keep articles up to date.
Related tools
All toolsRelated articles
More in Website Security Headers
Implement Referrer Policy for Enhanced Security and SEO
Implement a referrer policy to protect user privacy and prevent security vulnerabilities. Learn the benefits, best practices, and step-by-step guide to control referrer information.

Referrer Policy for Shopify Lead Gen
Discover the importance of referrer policy in lead generation and learn how to implement it on your Shopify store to drive more sales and protect customer data.

Permissions Policy for Restaurants
A well-crafted permissions policy can help prevent unauthorized access to sensitive features, ensuring a safer online experience for customers.