Is it possible to unset or remove CSP header in admin area?
-
Hi Guys,
Is it possible to unset or remove the Content Security Policy header in the WP admin area via functions?I’ve tried everything I can find – ie. header_remove, header_unset, etc.
I’ve tried <location . . .> based.
As it is, the CSP header is a real bugger to implement on WP. You can get it working “ok” on the front-end. But once you log in to the admin area then damn near everything is broken by it.
I’ve decided I have a love-hate relationship with the CSP header at this point. Especially on WP with all of the inline js and css in WP core, themes and plugins. Nonce is a royal pain to set up and easily hacked if done incorrectly. Hashes are easy to set up but will instantly break as soon the the theme, plugin or core changes.
At the moment I have mine set in “report only” mode to see if I can work it out in any way without the “unsafe” directive. Otherwise, “unsafe” defeats the whole purpose.
By the way, my server is Apache with Nginx – PHP 7.3.3 running FPM application served by Nginx. — This means removing this header in admin area via htaccess is not an option.
I appreciate any and all feedback you have on this.
Thank you!
LL
The topic ‘Is it possible to unset or remove CSP header in admin area?’ is closed to new replies.