< All Topics

How would you restrict the directory access by IP address?

If you want to make your admin areas secure from hackers, it’s better to allow access only from the selected IP address to the admin directory. You can just make .htaccess file in your directory where you need to restrict the access by IP Address.

For instance, if your WordPress blog has installed on the main directory such as example.com/wp-admin, it’s better to build .htaccess file in /wp-admin/.htaccess and you need to place this code, and do not forget to replace the allowed IP with your own IP address.

Order deny, Allow
Deny from all

(Replace “Your-IP-Address-Here” with the IP Address)

You need to check this out by accessing your /wp-admin IP address from some other IP address that is not allowed by your .htaccess file.

Scroll to Top