We just discovered a cool plugin called Restricted Site Access.
As the name suggests, the plugin helps you to restrict site access to certain IP. According to the author, this plugin will be a great solution for Extranets, publicly hosted Intranets, or parallel development / staging sites.
The settings page for this plugin isn’t so obvious. Once activated, you’ll see new additional settings from the Reading settings page. It can be accessed from Settings
> Reading
.
At the very bottom of the settings page, you’ll see an input field to whitelist any single IP address of range of IP address. Furthermore, for restricted visitors (those not in the whitelist IP), you can choose whether to send them to login page, redirect to specific site, show a simple message or redirect them to a specific WordPress page.
Futhermore, if you’d like to unrestrict specific parts of the site, there’s restricted_site_access_is_restricted filter to override the default setting. Please see the FAQ page for more information.
Hi,
Thanks for these tips, I definitely need to ban certain IP’s from visiting my site. They keep trying to leave all kinds of spam comments on my site.
I had no clue that you could do this. You just saved me from having to go through a bunch of spam comments. I seem to always get them from the same IP, it gets a little old after a while trying to get rid of those comments. Thanks for sharing this and I hope you have a great weekend.
Hi Susan,
This plugin only whitelist IP to access your site. Any IP not in the whitelist that trying to access your site will be redirected the login page (or any other page you’ve chosen in the settings page).
If you’d like to ban any IP from accessing your site, take a look at this plugin called Simple IP Ban http://wordpress.org/plugins/simple-ip-ban/