Int this tutorial we are going to discuss Restrict WordPress Admin Access by IP.
Are you interested about the safety of your WordPress website? And want to safe and secure the wordpress Admin panel? Limit admin access by IP is an efficient way to secure your WP admin panel. In this tutorial, we’ll show you how to limit WP admin access by IP using .HTACCESS file.
Allow Access to wodpress Admin from a particular IP
The giving example shows how you can allow access from a particular IP to wp-admin. It is very helpful when you want to grant access only from your IP.
Create a new .htaccess file and upload to the wp-admin folder. Now insert the following code in wp-admin/.htaccess.
If you want to authorize access to wp-admin from several IP addresses, list them as allow from IP on each new line.
allow from 126.96.36.199 allow from 188.8.131.52 allow from 184.108.40.206
Block IP Address to Obtain WP Admin
If you don’t want to block every IP but particular IP to access wp-admin, you can block that IP address separately using the .htaccess file.
Create a new .htaccess file and upload to the Wp Admin folder. Now add the below code in wp-admin/.htaccess file.
order allow,deny deny from 220.127.116.11 allow from all
Limit Access by IP address to wp-login.php file in WordPress
You can restrict access to the wp-login.php file by IP using .htaccess. Open the main .htaccess file and add the below code at top of the file.
<Files wp-login.php> order deny,allow Deny from all # allow access from my IP address allow from 18.104.22.168 # allow access from my IP address allow from 22.214.171.124 </Files>