Are you concerned about the security of your WordPress site? and want to secure the WP Administrative panel? Restrict admin access by IP Address is an effective way to secure your WordPress admin panel. In this tutorial, we’ll show you how to restrict WordPress admin access by IP using HTACCESS.
Allow Access to WP Admin from specific IP
The following example shows how you can allow access from a specific IP address to wp-admin. It is very useful when you want to allow access only from your IP address.
Create a new
.htaccess file and upload to the wp-admin directory. Now insert the following code in
order deny,allow allow from 188.8.131.52 deny from all
If you want to allow access to wp-admin from multiple IP addresses, list them as allow from IP on each new line.
allow from 184.108.40.206 allow from 220.127.116.11 allow from 18.104.22.168
Block IP Address to Access WP Admin
If you don’t want to block every IP but specific IP to access WP Admin, you can block that IP address individually using the .htaccess file.
Create a new .htaccess file and upload to the wp-admin directory. Now insert the following code in
order allow,deny deny from 22.214.171.124 allow from all
Restrict Access by IP to wp-login.php file in WordPress
You can limit access to the
wp-login.php file by IP address using HTACCESS. Open the main .htaccess file and insert the following code at top of the file.
<Files wp-login.php> order deny,allow Deny from all # allow access from my IP address allow from 126.96.36.199 # allow access from my IP address allow from 188.8.131.52 </Files>
Note that: Don’t forget to replace the IP address with your own.
Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request