How to Restrict WordPress Admin Access by IP address


0

Int this tutorial we are going to discuss Restrict WordPress Admin Access by IP.

Let’s Start

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 172.94.37.33
allow from 192.210.161.111
allow from 198.46.154.184

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 198.46.154.184
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 172.94.37.33

# allow access from my IP address
allow from 192.210.161.111
</Files>


Like it? Share with your friends!

0
Developer

0 Comments