Solved : WordPress Failed to Set Referrer Policy Error – W3 Total Cache

On Production WordPress site you might be got Failed to set referrer policy Error on your Console, it shows the following error:
“Failed to set referrer policy: The value ” is not one of ‘no-referrer’, ‘no-referrer-when-downgrade’, ‘origin’, ‘origin-when-cross-origin’, ‘same-origin’, ‘strict-origin’, ‘strict-origin-when-cross-origin’, or ‘unsafe-url’. The referrer policy has been left unchanged.”
{Read:- Best PWA WordPress Plugins 2021 }
Basically, the security response header called “referrer-policy” is being set to an empty value by web server. This type of header can contain the following information:
1 2 3 4 5 6 7 8 |
Referrer-Policy: no-referrer Referrer-Policy: no-referrer-when-downgrade Referrer-Policy: origin Referrer-Policy: origin-when-cross-origin Referrer-Policy: same-origin Referrer-Policy: strict-origin Referrer-Policy: strict-origin-when-cross-origin Referrer-Policy: unsafe-url |
On a web server you have a .htaccess file. This hidden file controls a lot of the behavior of the web server from the top to end. This is where you enable gzip compression, https redirection, protection of files and directory browsing, and setting cookies and headers.
You can find and replace :
1 2 3 4 5 |
Header set Referrer-Policy "" to Header set Referrer-Policy "origin" |
But if you are using the caching plugin in your WordPress site, most of the thing are generated by caching plugin in your.htaccess file. so in the case of W3TC (W3 Total Cache) Plugins you should control it by plugin settings.
{Read:- How to edit ads.txt without Cpanel in WordPress }
- Go to w3 total cache Menu.
- Click on Browser cache Tab.
- Search , select the Value.