Need help? Call us on 1300 789 260

How to set up fail2Ban in Plesk 12 for Wordpress logins

Difficulty: Intermediate


  • Admin login to Plesk
  • Fail2Ban enabled


Fail2Ban is a new feature in Plesk 12 that allows users to set up filters to block ip addresses to prevent things like brute force attacks. The following support articles outlines how to configure Fail2Ban for WordPress. This article assumes you already have Fail2Ban to installed and configured, if not you can read our guide here .


  1. From the Admin bar on the left hand side menu, click on “Tools & Settings”, then click on “IP Address Banning (Fail2Ban)”.
    Fail2ban Wordpress

  2. Under “IP Address Banning” click on the “Jails” tab.
    Fail2ban Wordpress

  3. Under the “Jails” tab, click on “Manage Filters”.
    Fail2ban Wordpress

  4. From the “Jail Filters” screen click “Add Filter”.
    Fail2ban Wordpress

  5. From within the “Add Jail Filter” give the filter a meaningful name in the “Name” field. Then in the “Content” field add the following:
    Fail2ban Wordpress

    failregex = <HOST>.*] "POST /wp-login.php
    ignoreregex =
  6. Navigate back to the “Jails” screen. Alternatively you can click on the green arrow “Up Level” icon in the top right hand corner.
    Fail2ban Wordpress

  7. From under the “Jails” tab click on “Add Jail”.
    Fail2ban Wordpress

  8. [A] – Under “Name”, give the Jail a meaningful name, we used the same as the filter for ease of management. Under “Filter” select the filter we created in the pervious steps.

    [B] – Enter the below details, updating “name=WPLogin” with the name you have give the Filter.

    iptables-multiport[name=WPLogin, port="http,https"]

    [C] – This step is optional but allows email notifications to be set up for instances of where IP addresses have been jailed. Under “dest” specify the email address notifications are to go to. Then from the “Action” drop down list select “sendmail-whois”.


    [D] – Specify the directory of the access log of the site/s.


    [E] – Specify the duration of the ban of an ip address, and the number of attempts before its banned.

    Click “OK”. The filter is set up on the server.
    Fail2ban Wordpress

Was this article helpful? Yes No

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260