Skip to content

Instantly share code, notes, and snippets.

@rileybathurst
Created July 28, 2021 21:28
Show Gist options
  • Save rileybathurst/3292d5a7a8d3d1e5764b3b3a385fce30 to your computer and use it in GitHub Desktop.
Save rileybathurst/3292d5a7a8d3d1e5764b3b3a385fce30 to your computer and use it in GitHub Desktop.
WordPress CSP starting point
<IfModule mod_headers.c>
Header set Content-Security-Policy: "default-src 'self'; \
style-src 'self' 'unsafe-inline'; \
script-src 'self' https://www.google.com https://www.gstatic.com https://cdn.jsdelivr.net 'nonce-351731468999'; \
img-src 'self' secure.gravatar.com; \
font-src 'self' data:; \
child-src https://www.youtube.com https://player.vimeo.com; \
frame-ancestors 'none';"
Header set Strict-Transport-Security: max-age=63072000
Header set X-Content-Type-Options: nosniff
Header set X-Frame-Options: DENY
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment