Nonce injection modes
Choose between Compatibility mode for broad script rewriting and WordPress Hooks mode for stricter enqueued-script and style handling. Nonces are injected automatically into inline scripts and registered enqueues.
Free WordPress Content Security Policy plugin
aCSP Builder 1.5.1 lets you build, test, and enforce Content Security Policy headers directly from the WordPress admin — nonce and hash directives, preset frameworks, violation reporting, and administrative controls without a paid license.
Full CSP lifecycle from one WordPress admin page
Designed for WordPress administrators who need granular CSP control without breaking themes, plugins, or third-party integrations.
Choose between Compatibility mode for broad script rewriting and WordPress Hooks mode for stricter enqueued-script and style handling. Nonces are injected automatically into inline scripts and registered enqueues.
Allowlist SHA-256, SHA-384, and SHA-512 values for scripts and styles. Hashes are placed on standard directives by default and on attribute directives when 'unsafe-hashes' is present.
Start from curated presets that balance security and compatibility for common WordPress setups — or build a fully custom policy from scratch.
Test new policies in Report-Only mode before enforcing them. Violations are collected without blocking content, giving you data to refine your policy.
Collect, browse, and export CSP violation reports from a dedicated admin page. Payload, rate, retention, and query-index controls protect the public endpoint.
Test third-party report endpoints with WordPress safe HTTP requests and TLS verification before switching away from the built-in collector.
Optionally emit CSP as an HTML meta tag for page-level policies. Report-Only mode skips meta output to avoid accidental enforcement.
Enable the upgrade-insecure-requests directive to instruct browsers to rewrite HTTP URLs to HTTPS before loading resources.
Curated presets balance security with real-world WordPress compatibility. Each preset is a complete starting policy you can customize.
Restrictive policy with nonce-only scripts, no inline styles, and minimal external origins. Best for sites with fully controlled assets.
Balanced policy with nonce for scripts, hashes for inline styles, and allowlisted CDN origins. Works with most WordPress setups.
Relaxed policy that allows inline scripts and styles with nonces, broad origins, and fallback directives. Useful during migration or testing.
Start from a blank policy and build every directive manually. Full control over every CSP value, nonce mode, and hash setting.
CSP values, endpoints, and storage are validated, sanitized, and permission-checked before any action is taken.
Embedded directive delimiters cannot create hidden directives. Hash values are validated as proper SHA-256, SHA-384, or SHA-512 strings.
Custom endpoint tests use WordPress safe HTTP with TLS verification. Built-in endpoint has payload, rate, retention, and row-count controls.
All preset and reset mutation handlers require manage_options capability. Ajax handlers verify nonces and user permissions.
Remote endpoint testing validates URLs and uses WordPress HTTP API with TLS, preventing server-side request forgery vectors.
Upload to WordPress plugins folder, activate aCSP Builder, and open the new CSP menu item in the WordPress admin.
Select a preset from the presets page or open the custom builder to define every directive manually.
Select Compatibility or Hooks mode for nonce injection. Add hash allowlists for inline scripts and styles that cannot use nonces.
Enable Report-Only mode to collect violations without blocking resources. Review reports to identify needed policy adjustments.
When your policy passes testing, switch to Enforce mode. Browsers will apply CSP headers and block policy violations.
Install aCSP Builder from GitHub and build a Content Security Policy that protects your WordPress site without breaking it.