Limit WordPress Admin Access To One IP Address

Earlier we have discussed about removing dashboard access on WordPress and BuddyPress powered websites and easily disallow either all or selected user roles from accessing your site’s admin area dashboard.

We ave also discussed about hiding admin toolbar and directing users to home whenever they attempt to access admin section of your WordPress site by suffixing /wp-admin after your website’s address.

Now today in this lesson you will learn how to increase the security of your website by only enabling one IP addresss to access admin area dashboard. 

This can easily be done by adding a few lines of code in .htaccess file located in your website’s root directory.

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName “Access Control”
AuthType Basic
order deny,allow
deny from all
#IP address to Whitelist
allow from

Simply, open the file and paste the given code replacing with your IP address.

You cane asily find your IP address by searching ‘what is my IP address’ in Google or simply visit

Also read our tutorial on limiting admin access to logged-in users or selected IP addresses.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.