{"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

Fixing the Referrer Policy<\/h2>\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

Header set Referrer-Policy ""<\/code><\/pre>\n\n\n\n

You can simply set a valid policy by changing to:<\/p>\n\n\n\n

Header set Referrer-Policy "origin"<\/code><\/pre>\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