Add this code to your .htaccess file to allow logins from certain IP addresses and disallow login access to anyone else. This is a great code snippet for WordPress installations from one or few authors with static IP addresses.

<Files wp-login.php> Order Deny,Allow Deny from all Allow from xx.xx.xx.xx </Files>

Replace xx.xx.xx.xx with your IP address and if there are multiple IPs just repeat the “Allow from xx.xx.xx.xx” line below.

If your IP address ever changes, just simply just the IP address.

This code is not great for several authors using different IP addresses or if your IP address is dynamic and not static – meaning your IP address constantly changes.

Download (tar.gz)