2010
Allow WordPress admin login from specific IPs or IP range
Its good security practice to allow admin logins from specific IPs only. So, even if your WordPress admin login details is hacked, you are still safe. Hackers will not be able to login in admin area of WordPress, and your blog is safe.
This can be achieved easily by using a .htracess file in wp-admin folder.
How can I allow admin login from one specific IP
Open notepad and copy paste following codes.
AuthUserFile /dev/null AuthGroupFile /dev/null AuthName "Admin Access Control" AuthType Basicorder deny,allow deny from all allow from xx.xx.xx.xx
NOTE: Change xx.xx.xx.xx to your IP.
Upload this text file in wp-admin folder and rename it to .htaccess
Done!!
Lets say your IP is 122.162.160.9
If your IP is 122.162.160.9, you should replace xx.xx.xx.xx in above code to 122.162.160.9
Now only person from 122.162.160.9 will be able to login in wordpress admin panel.
How can I allow admin login from many specific IP
If you want to allow login from multiple specific IPs, you just need to add those IPs in .htacess file we made above.
Something like this:
AuthUserFile /dev/null AuthGroupFile /dev/null AuthName "Admin Access Control" AuthType Basicorder deny,allow deny from all allow from aa.aa.aa.aa allow from bb.bb.bb.bb allow from cc.cc.cc.cc allow from dd.dd.dd.dd
Note:
Like this, you can allow multiple IPs to login as admin.
How can I allow admin login from a IP range
This is common question asked by many wordpress users. Many people like me are on DSL connection and have dynamic IP. Our IP changes everytime, we start computer or restart modem. So, people on dynamic IP need to allow a specific IP range.
You need to use below code for .htaccess file to allow a complete IP range.
AuthUserFile /dev/null AuthGroupFile /dev/null AuthName "Admin Access Control" AuthType Basicorder deny,allow deny from all allow from 67.22.xx.xx
Note:
Lets say your IP current IP is 122.45.673.46
Then you should use like 122.45.xx.xx
Warning
If you still have confusion, please let me know via comment.



