Wordpress is one of the most used CMS over the world. Upon recent stats, Around 90 percent of all the hacked websites were WordPress sites. We can restrict the IP Addresses on the Wordpress Dashboard to prevent such issues.
There are 2 methods to achieve this purpose. You can add a .htaccess to restrict IP Address or you can add plugins to Block IP Address.
IP Address restriction with .htaccess
We can add a .htaccess file inside the wp-admin directory and add a below content. Add the IP address from which you want to allow the Wordpress admin access.
# order deny, allow # Replace the below x.x.x.x with your IP address # allow from x.x.x.x deny from all
Plugins to restrict IP Address
- Login to Wordpress Dashboard.
- Click on Plugins.
- Click on Add New Plugin.
- Type WP Ban in Keyword. Install and Activate the same Plugin.
- Now, click on settings and hit Ban Button. Here, you can add IPs or IP Range in respective boxes as given in below screen capture.
- Click on Save Changes.