Skip to content

Instantly share code, notes, and snippets.

@jasonhinkle
Last active November 24, 2015 05:57
Show Gist options
  • Save jasonhinkle/966aee379b170f365e6f to your computer and use it in GitHub Desktop.
Save jasonhinkle/966aee379b170f365e6f to your computer and use it in GitHub Desktop.
Limit access to Wordpress admin interface to specific IP address
# LIMIT WORDPRESS ADMIN ACCESS TO A WHITELISTED IP ADDRESS
# REPLACE 255.255.255.255 WITH YOUR OWN IP
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin/.*
RewriteCond %{REQUEST_URI} !wp-admin/admin-ajax\.php$
RewriteCond %{REMOTE_ADDR} !^255.255.255.255$
RewriteRule ^(.*)$ - [R=403,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment