Whitelisting : – all IP addresses are blocked except for specific IP addresses that are allowed.

Blacklisting – IP address means to block a specific set of IP addresses, while ‘whitelisting’ allows access to just a specific set of IP addresses.

That is – when you whitelist an IP address on a website, you grant access only to a specific network.

A user can switch devices on that network, but they’ll need to be connected to a network with whitelisted access to reach the your site.

Whitelisting Advantages :

  • Enables you to control who accesses your website. Limiting access only to specific IP addresses can help you prevent attacks on your site.
  • Login – Is more effective than implementing login security measures. When you implement an IP whitelisting feature, you essentially designate a full-time security guard that makes sure only the people you’ve approved can enter that door.

Whitelisting Disadvantages :

  • If you have large customer base then you can not Whitelisting IP or it’s difficult to maintain.

How to whitelist IP addresses in WordPress :

1) htaccess : The file we need to modify for this feature to work properly is called .htaccess. It’s a WordPress core file that communicates directly with your server and enables you to set up ‘rules’.

In this case, we’re going to tell it to block access to your dashboard login page for IPs not on an approved list.

you’ll need to log into your site directly using File Transfer Protocol

With your FTP client open and running, look for your website’s root folder. This is often named after your domain, but might also be called www or root. With this folder find the .htaccess file

Right-click on this file, and select Edit. This will open the file in your default text editor, enabling you to make changes. On a new line at the bottom of the file, paste in the following snippet:

RewriteCond %{REMOTE_ADDR} !^$

If you don’t like editing your .htaccess file directly or if don’t have access server or FTP , you can also use the free IP Ban WordPress plugin

2) Login : Using WP User, you can easily add Whitelisting ips, you will also need to not only list individual addresses to be Whitelisting but also IP masks and IP ranges.

Using WP User you can Whitelisting :

  • Single IP addresses Ex.
  • IP ranges such as Ex.
  • IP masks Ex.210.98.*.*.


Enter IP (,) Comma separated like as follow :,,,,




Learning how to whitelist IP addresses in WordPress is simple, and it’s a highly effective way to protect your website from intruders.

Do keep in mind that if you want to implement this security measure, you’ll have to ask all your user for their IPs, and figure out a way for those with dynamic addresses to be able to do their jobs.