Knowledge base article

Remove Wordfence firewall block via MySQL CLI

View other technical support articles

This guide will teach you how to remove a Wordfence firewall block using MySQL command line tools

Has WordFence blacklisted you from your own website? Fear not! This guide will teach you how to regain access by removing the Wordfence firewall block via MySQL command line interface.

To complete this guide, please ensure you have:

  • SSH Access - Serversaurus relies on key based authentication to login via SSH/SFTP, if you haven't already, generate your SSH key pair and configure it in cPanel before proceeding with the next steps
  • MySQL database credentials - These can be found within the wp-config.php file.

Let's get started!

  1.  SSH to your hosting server.
  2. Login to MySQL using the below command, enter your password when prompted:
    Update the following command with your MySQL user

    mysql -u mysql_user -p;
  3. Change into your database:
    Update the following command with your MySQL database

    use database_name;
  4. Now we're going to clear all WordFence blocks by truncating the wp_wfblocks7 table:
    Update the following command with your database prefix, the default WordPress DB prefix is wp_

    TRUNCATE TABLE wp_wfblocks7;

Nice work! The block will now be removed! 

Last updated November 30, 2023

Can't find what you're looking for?

Submit a question

  • Drop files here or
    Max. file size: 2 MB, Max. files: 3.
    • This field is for validation purposes and should be left unchanged.