Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ideadude/c36a0a726b094814a27e447c7adc786a to your computer and use it in GitHub Desktop.
Save ideadude/c36a0a726b094814a27e447c7adc786a to your computer and use it in GitHub Desktop.
Block direct execution of PHP inside wp-content/plugins or wp-content/themes
# Block direct execution of PHP inside wp-content/plugins or wp-content/themes
# Add these lines above the WP core rules in .htaccess.
RewriteEngine On
RewriteRule ^wp-content/plugins/[^/]+/.*\.php$ - [F,L]
RewriteRule ^wp-content/themes/[^/]+/.*\.php$ - [F,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment