Skip to main content

How Do I Restrict My IP Address From Accessing the WordPress Dashboard?

WordPress is one of the most popular content management systems (CMS) in the world. According to recent statistics, approximately 90% of all hacked websites were WordPress sites. However, we may avoid such problems by blocking IP addresses in the WordPress Dashboard.

 

There are two ways to block IP addresses:

 

Adding a.htaccess file to limit IP addresses 

Adding IP Address Restriction Plugins 1. IP Address Restriction Using.htaccess

 

We can create a.htaccess file in the wp-admin directory and include the following text -

# order deny, allow
# Replace the below x.x.x.x with your IP address #
allow from x.x.x.x
deny from all

Then enter the IP address from which you want WordPress admin access.

2. IP Address Restriction Plugins

 

Access the WordPress Dashboard.

Select Plugins.

Click the Add New button next to the Plugins option.

In the box next to the Keyword, type WP Ban.

Install and activate the identical Plugin.

Now, go to Settings and select the Ban option.

You can enter IP addresses or IP ranges in the corresponding boxes as seen in the screenshot below -

Click the Save Changes button.