{"id":8510,"date":"2020-04-08T15:00:27","date_gmt":"2020-04-08T19:00:27","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=8510"},"modified":"2021-12-08T10:17:19","modified_gmt":"2021-12-08T15:17:19","slug":"failed-to-set-referrer-policy","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/failed-to-set-referrer-policy\/","title":{"rendered":"How to fix Failed to set Referrer Policy"},"content":{"rendered":"\n
Here’s how to fix the Failed to set Referrer-Policy warning in the Chrome console from a website for example a WordPress-based one.<\/p>\n\n\n\n
You might be a developer working on a website<\/a> and you encounter the Google Chrome console error “Failed to set Referrer-Policy<\/strong>“. If that is the case we will show you how to fix it in this guide.<\/p>\n\n\n\n Just in case, the entire warning looks like this:<\/p>\n\n\n\n Failed to set referrer policy: The value ‘http:\/\/example.com\/some-path\/’ is not one of ‘always’, ‘default’, ‘never’, ‘no-referrer’, ‘no-referrer-when-downgrade’, ‘origin’, ‘origin-when-crossorigin’, or ‘unsafe-url’. The referrer policy has been left unchanged.<\/p><\/blockquote>\n\n\n\n You can manually fix the problem by changing the directive in the .htaccess<\/strong> file. It is highly likely your directive looks like this:<\/p>\n\n\n\n you can manually find and change as follows in .htaccess<\/strong> file<\/p>\n\n\n\n You can simply set a valid policy by changing to:<\/p>\n\n\n\n A referrer-policy modifies the algorithm used to populate the Referer header when fetching subresources, prefetching, or performing navigations. Every environment settings object has an algorithm for obtaining a referrer policy, which is used by default for all requests with that environment settings object as their request client.<\/em><\/p>\n\n\n\n From the definition above, this policy deals with what information is related to the URL the browser ships to a server to retrieve an external resource.<\/p>\n\n\n\n This policy comes with several optional values which are described here.<\/p>\n\n\n\n There may be cases where the setting is fine but you still get the warning. It could be third-party interference such as that from an Ad-blocker.<\/p>\n\n\n\n You can find out more about using this policy as well as browser<\/a> compatibility from the links below.<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" Here’s how to fix the Failed to set Referrer-Policy warning in the Chrome console from a website for example a WordPress-based one. You might be a developer working on a…<\/p>\n","protected":false},"author":1,"featured_media":8511,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,27,16],"tags":[58,106,313,320,433,449,526,635,636,638,643,651],"yoast_head":"\nFixing the Referrer Policy<\/h2>\n\n\n\n
Header set Referrer-Policy ""<\/code><\/pre>\n\n\n\n
Header set Referrer-Policy "origin"<\/code><\/pre>\n\n\n\n
no-referrer<\/code> which specifies that no referrer information is to be sent along with requests made from a particular request client to any origin. The header will be omitted entirely.<\/li>
no-referrer-when-downgrade<\/code> doesn’t send Referrer header to a non-priority authenticated URL (if an https URL links to an HTTP URL no header is sent)<\/li>
same-origin<\/code> policy specifies that a full URL, stripped for use as a referrer, is sent as referrer information when making
same-origin<\/code> requests from a particular request client. while Cross-origin requests won’t contain referrer information.<\/li>
origin<\/code> sends the scheme, host, and port (basically, the subdomain) stripped of the full URL as a referrer, i.e. https:\/\/moz.com\/example.html would simply send https:\/\/moz.com for all.<\/li>
origin-when-cross-origin<\/code> sends the format described in origin to cross-origin, while a full stripped URL is sent to
same-origin<\/code> requests.<\/li>
unsafe-url<\/code> policy specifies that a full URL, stripped for use as a referrer, is sent along with both
cross-origin<\/code> requests and same-origin requests made from a particular request client.
it’s unsafe because it will leak origins and paths from TLS-protected resources to insecure origins.<\/li>""<\/code> corresponds to no policy, causing a fallback to a referrer policy defined elsewhere, or in the case where no such higher-level policy is available, defaulting to
no-referrer-when-downgrade<\/code>.<\/li>
always<\/code> behaves like
unsafe-url<\/code>.<\/li><\/ul>\n\n\n\n
In Conclusion<\/h2>\n\n\n\n