Discouraging unwanted visitors

Sometimes you just want to stop those unwanted visitors knocking at the door (and trying to force entry to your WordPress blog) – here’s one way to do it

Block the ip address

create/modify your .htaccess file

order allow,deny
deny from the.blocked.ip.address
allow from all

simple but effective.

Only allow access from your ip address

You may want to restrict access even further.

Including this fragment in your .htaccess file will only allow access to the wp-login.php file from a specified ip address.

<Files wp-login.php>
        order deny,allow
        Deny from all
# whitelist Micks IP address
allow from the.required.ip.address

Add addtional permitted addresses as appropriate

Limit access to the wp-admin folder

Create, or modify, a .htaccess file in the wp-admin folder

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "WordPress Admin Access Control"
AuthType Basic
order deny,allow
deny from all
# whitelist Mick's IP address
allow from the.required.ip.address

Useful Links