Skip to content

Instantly share code, notes, and snippets.

@metelidrissi
Created October 11, 2022 14:05
Show Gist options
  • Save metelidrissi/75e9826766dc9be40139c2c6bf524c7f to your computer and use it in GitHub Desktop.
Save metelidrissi/75e9826766dc9be40139c2c6bf524c7f to your computer and use it in GitHub Desktop.
Allow access to wp-admin only to certain IPs - Dentro de /wp-admin
#Protect wp-admin
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "WordPress Admin Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
allow from 123.456.78.91
allow from 112.131.41.16
</LIMIT>
#Allow access to wp-admin/admin-ajax.php
<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment