Skip to content

Instantly share code, notes, and snippets.

@douglascabral
Last active June 29, 2020 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascabral/98b9cd4dd8dbd33361d062caa3f9eb02 to your computer and use it in GitHub Desktop.
Save douglascabral/98b9cd4dd8dbd33361d062caa3f9eb02 to your computer and use it in GitHub Desktop.
Improve WP Security
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
RewriteRule (vendor|node_modules) - [R=404,L,NC]
RewriteRule Gruntfile.js - [R=404,L,NC]
RewriteRule gulpfile.js - [R=404,L,NC]
RewriteRule package.json - [R=404,L,NC]
RewriteRule package-lock.json - [R=404,L,NC]
RewriteRule yarn.lock - [R=404,L,NC]
RewriteRule composer. - [R=404,L,NC]
RewriteRule phpunit - [R=404,L,NC]
Options -Indexes
<Files "wp-config.php">
Order Allow,Deny
Deny from all
</Files>
<Files "wp-config-sample.php">
Order Allow,Deny
Deny from all
</Files>
<files xmlrpc.php>
order allow,deny
deny from all
</files>
<files wp-comments-post.php>
order allow,deny
deny from all
</files>
<files readme.html>
order allow,deny
deny from all
</files>
<files license.txt>
order allow,deny
deny from all
</files>
<files wp-links-opml.php>
order allow,deny
deny from all
</files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment