24/7 Sales & Support.  Call 1300 368 359 Click to Call
The sexy world of
hosting & domains

How to Ban IP Address WordPress

23/01/2017

Banning a particular IP address for a site achieves very little. If you are trying to keep spammers away, a single IP address won’t aid your cause to a great degree. That’s because anyone who is determined enough will easily change their IP. Blocking a range of addresses and user agents, or the number of requests placed within a certain time period might be more beneficial. There is, however, a situation where you can block an IP address, such as when a commenter is consistently violating your terms and agreements.

These unruly characters that use profane language, attack users, or peddle their own self-seeking agendas are all very familiar. And they are neither bots nor spiders. If your commenting system is the native one provided by WordPress, they can change the name they use to appear as if they are different people. Only you can see if they are the same person through the backend by reviewing their IP address.

Chances are these people won’t go so far as changing their IPs if you block them out. Any threats you might give quickly be disregarded. WordPress allows you to moderate these comments through its moderation system, but when you want to keep them out completely, here is how you can do so.

.Htaccess

This method is uncomplicated as it needs no plugins or code adjustments. If you can access your file system, the.htc access file might offer the most convenient way of blocking them out. If there is a particular comment from an IP address you want to keep out, here is how:

Open the .htc access, and place these lines in the beginning.

Order allow, deny

Deny from 96.42.14.13

Allow from all

Once you save the file, visitors from that specific address will be locked out, as long as the above instructions remain active.

Plugins

WordPress has a variety of security plugins that enable you to perform various security tasks. These tools can allow you block IP addresses. Many of them are very intuitive, and all you have to do is to key in the address you want to keep out.

Temporary Banning

IP addresses are inherently dynamic in that they change from time to time. For this reason, banning a particular address for good is not recommended as it might be assigned to someone else down the line. Temporary blocks are therefore more ideal as they forestall such kind of a situation. The ‘Ban System by IP and Country’ is one good plugin that you can use for this. Once installed, the bottom left side has a dashboard and configuration screen. Click on the ‘Add’ Tab and ban the specific address for the duration that you would like. A one month ban often suffices, as the ‘trolls’ are unlikely to wait around for that long.

Recommended for you

Cloud Hosting in 3-2-1

Characterised through its storage of websites over multiple virtual servers, the benefits of cloud hosting…

Read more

Why Localised Hosting is Best for Australian Businesses

With the internet opening up boundless avenues for companies worldwide, there has been an increase…

Read more

5 Musts For Choosing a Web Host

With retail sales worldwide reaching more than $28 trillion in 2018, it is now more…

Read more

testimonial-alex-quote