Defender Lockout Log Size

We are using Defender on multiple sites, some of which get many 404 and login attempts. The blocking is great, but I’m starting to worry about the log sizes. After a couple months, we have 854 pages of logs for one site alone.

Is there a way to auto-purge or disable the lockout logs? Thanks!

  • Adam Czajczyk
    • Support Gorilla

    Hello Brian,

    I hope you’re well today and thank you for your question!

    You are referring to “lockout logs” (“Defender -> IP Lockouts -> Logs” page), is that correct? I’m asking because it’s supposed to show you a lit of lockouts for last 30 days only and you mentioned that “after a couple of months” you got the log grown over 850 pages long.

    Does it show you logs older than last 30 days as well?

    Let me know please.

    Best regards,

    Adam

  • Predrag Dubajic
    • Support

    Hi Brian,

    Lockout logs are stored inside wp_posts table so you can check the size of that table.

    As for purging and disabling the log, I’m afraid that this is not possible at this moment but I’ll chat with dev about adding that.

    For now you can add below code to your theme functions.php or as mu-plugin and that will limit number of days log is stored for:

    add_filter( 'ip_lockout_logs_1store_backward', function ( $interval ) {
    $interval = '-1 days';

    return $interval;
    } );

    You can change the value for number of days it will store it, in above code it’s set to 1 day.

    Please note that this is a cron job so when you add the code it may took some time for changes to take place.

    Best regards,

    Predrag

  • Nathan
    • Design Lord, Child of Thor

    Yeah a way to clear this would be wonderful, its the largest table in my whole db. I have 4530 pages containing 90597 results! Please let us know how to clear it. I believe this is creating some what of a slow down in performance on our system.

  • Dimitris
    • Support Star

    Hey there Nathan,

    hope you’re doing good and thanks for reaching us! :slight_smile:

    Apart from the little snippet that Predrag shared before on how to limit these reports to fewer than 30 days, you should be able to remove any records from wp_posts table (where wp_ your database prefix) where post_type is wd_iplockout_log.

    Hope that was some help, let us know if further assistance is required here!

    Take care,

    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.