Hello Themeco Team, hope your day is going well!
I have a small issue with a client site in order to get a 100% error-free page render. Here is the 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.
Here is the page:
I have tried the following two fixes:
- update the .htaccess to set the referrer policy (https://www.blackhillsinfosec.com/fix-missing-referrer-policy-website/). This was the code added to the headers module:
RequestHeader set X-HTTPS 1 Header set Referrer-Policy "no-referrer-when-downgrade"
- update the global functions.php of my child theme to set referrer policy (https://benrabicoff.com/adding-secure-http-response-headers-wordpress/). Here’s the code I added:
add_action('send_headers', function(){ // Referrer Policy header("Referrer-Policy: no-referrer-when-downgrade"); }, 1);
After clearing my cache, doing multiple browser tests, and also testing on Security Headers, I am unable to get the referrer policy to be recognized. Link: https://securityheaders.com/?q=wraplabs.com&followRedirects=on
Please let me know what other details you need, but definitely trying to remove this one annoying issue. Thanks!