I found a blog post that talks about setting up Wordfence and fail2ban but it's quite useless as there is no mention of any technical activity. Only that it took the author a total of 5 hours.

I would like to set up fail2ban with Wordfence myself in less than 5 hours. And if I have to figure things out myself and take more time I would like to document it so that others can do it in less than 5 hours. Hence the question here: how to set up fail2ban with Wordfence?

A quick start:

sudo apt-get install fail2ban
wp plugin install --activate wordfence

This post looks a lot more useful already but there's no mention of Wordfence.

  • f2b works independently from wordfence, they work on another level, like network and application level.
    – prosti
    Sep 28, 2016 at 21:09
  • hi accept my answer and get 2 more points :)
    – prosti
    Dec 16, 2016 at 10:30
  • 8 people upvoted the question and none of those upvoted your answer (because I did and it's the only upvote).
    – the
    Dec 16, 2016 at 15:13
  • I came very late with the answer. Maybe this is why. :(
    – prosti
    Dec 16, 2016 at 15:18

1 Answer 1


This question really deserves some attention. WordFence looks like one of the most popular plugins for security nowadays. Compared with the iThemes security it is like 2.6:3.2 where iThemes Security (former Better WP Security) won. Of course these were thousand of 5 stars.

The author of the WordFence wrote this section:

My WordPress site is behind a firewall. Doesn't that make it secure?

If your site is accessible from the web, it means that people you don't know can execute PHP code on your site. They have to be able to execute PHP code, like the core WordPress code, in order for your site to work.

What a nonsense so far. I will not paraphrase much more, you can check from the https://wordpress.org/plugins/wordfence/faq/

The important thing is WordFence works like application level firewall. Similar like .htaccess files works for Apache.

What WordFence do as a firewall? It logs requests information to your database. So better you have SSD disk on your hosting if you need fast web site.

Fail2ban works on network level. In Python it communicates with iptables, and TCP sockets, and can work with error.log file, auth.log, and access.log files - whatever you set in config. http://www.fail2ban.org/wiki/index.php/Main_Page

All you need to configure for fail2ban are jails


Here you will get the overview what to do. But the question is who uses that anymore?

Fail2ban cannot protect well not even their page (provided you in the upper link). The limitation is it cannot work well with IPv6 addresses.

So I guess you should consider some other firewall. This may be a good question for some other time.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.