I got locked out of my WordPress by Defender

I got locked out of my WordPress by Defender…

Since I am the Admin, how can I get back in to add my IP address to the Whitelist so this doesn’t happen again and/or how can I remove my IP address from the ban list? Thanks!

I have access to the MySQL database and server files if that helps…

  • Coastal Data
    • Information Technologist

    Hello, I’ve got the same problem on a site right now. A quick answer for how to get back into the site is to go into the WPMUDEV control panel for the site, and disable the Defender plugin… That allows you to get back into the site. But, then, how to adjust the settings? When I re-enabled mine, I got locked back out again. Maybe after the timeout, we’d be able to re-enable it and get back in?

  • Vaughan
    • Ex Staff

    Hi Nikishna,

    Hope you’re well?

    Can you try adding the following to your theme functions.php

    add_filter( 'ip_lockout_default_whitelist_ip', function ( $ips ) {
    $ip = 'YOUR IP HERE';
    $ips[] = $ip;

    return $ips;
    } );

    Add your current IP in the code where it says ‘YOUR IP HERE’.

    That should hopefully get you back in.

    Hope this helps

  • Nikishna
    • Design Lord, Child of Thor

    That worked Perfectly, thank you! I added my work IP address to the Whitelist so that it doesn’t happen again. I guest the auto-saved password was outdated, which after 5 tries, locked the system down. Glad it works!