Unable to Explicitly Set Referrer Policy in Pro

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:

  1. 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"

  1. 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!

Hi,
I’ve checked your website and I can see the referrer policy was set correctly:

Also, the browser console is clear at my end:

Are you sure you still have this issue?

Thanks.

Hi @Alaa thanks for responding.

I just checked on my Mac and PC in Chrome incognito mode and am still seeing the issue. If you keep looking at the Security Headers scan you’ll see the Referrer Policy in the summary is blank and there’s a yellow warning further down the page about it not being set correctly.

It is interesting that you’re not getting the error alert in Inspector though. Hmm. Screenshot attached, thanks.

Hello There,

Since nothing else works, would you mind providing us the ftp login credentials so we can take a closer look?

To do this, you can make a post with the following info:

  • WP Login url
  • WP Username
  • WP Password
  • FTP Hostname
  • FTP Username
  • FTP Password

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.