Are you worried about the security of your WordPress site? what’s more, need to secure the WP Administrative panel? Limit admin access by IP Address is a compelling method to secure your WordPress admin panel. In this instructional exercise, we’ll show you industry standards to limit WordPress admin access by IP utilizing HTACCESS.
Allow Access to WP Admin from specific IP
The following example shows how you can allow access from a particular IP address to wp-admin. It is exceptionally valuable when you need to allow access just from your IP address.
Make another .htaccess record and transfer to the wp-admin index. Presently embed the following code in wp-admin/.htaccess document.
2 3 4 5 6 |
order deny,allow allow from 172.94.37.38 deny from all |
If you need to allow access to wp-admin from multiple IP addresses, put them as allow from IP on each new line.
2 3 4 5 6 |
allow from 172.94.37.38 allow from 192.210.161.121 allow from 198.46.154.188 |
Block IP Address to Access WP Admin
If you would prefer not to block each IP yet specific IP to access WP Admin, you can block that IP address exclusively utilizing the .htaccess record.
Make another .htaccess record and transfer to the wp-admin registry. Presently embed the following code in wp-admin/.htaccess document.
2 3 4 5 6 |
order allow,deny deny from 198.46.154.188 allow from all |
Restrict Access by IP to wp-login.php file in WordPress
You can control access to the wp-login.php file by IP address utilizing HTACCESS. Open the root .htaccess record and embed the following code at best of the document.
2 3 4 5 6 7 8 9 10 11 12 13 |
<Files wp-login.php> order deny,allow Deny from all # allow access from my IP address allow from 172.94.37.38 # allow access from my IP address allow from 192.210.161.121 </Files> |
Pradeep Maurya is the Professional Web Developer & Designer and the Founder of “Tutorials website”. He lives in Delhi and loves to be a self-dependent person. As an owner, he is trying his best to improve this platform day by day. His passion, dedication and quick decision making ability to stand apart from others. He’s an avid blogger and writes on the publications like Dzone, e27.co