Easy CSP Headers
Add CSP headers to any WordPress site
by Paul Faulkner · github.com/headwalluk/easy-csp-headers · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/headwalluk/easy-csp-headers/archive/refs/heads/main.zipA WordPress plugin that automatically generates and injects Content Security Policy (CSP) headers with nonces for enhanced security.
Features
- ✅ Automatic Nonce Generation - Unique nonce for every page load
- ✅ HTML Processing - Uses WordPress
WP_HTML_Tag_Processorfor safe, fast HTML manipulation - ✅ Strict-Dynamic Support - Modern CSP with automatic script trust propagation
- ✅ Report-Only Mode - Test CSP without breaking your site
- ✅ Flexible Configuration - Granular control via settings page
- ✅ Cache-Friendly - Works seamlessly with page caching plugins
- ✅ WordPress Standards - Follows WordPress Coding Standards
How It Works
- Captures Output - Hooks into
template_redirectand starts output buffering - Generates Nonce - Creates a cryptographically secure nonce
- Processes HTML - Adds nonce attributes to `