The following instructions are for site owners.  If you are trying to regain access to a site that you do not manage, please contact the site owner for access.


First please make sure that it’s actually Wordfence that is locking you out of your site. There are many plugins that offer a “lock out” feature and quite a few of them that don’t work well. 


If you are locked out by Wordfence you’ll see a message giving you a reason you’re locked out and explaining how to unlock access to your own site. Whenever Wordfence locks a user out it provides a “Reason:” with a reason describing why you’re locked out. You can use this reason to determine which firewall rule you need to modify to prevent this from happening in future. 


If you post on the forums, make sure you include the “Reason: [explanation]” text or a screenshot of the locked-out page so that we can tell you what to change to prevent getting locked out in future. 


Here’s how you regain access to your site: The easiest way to solve this problem immediately is to simply rename the Wordfence folder in your WordPress installation. You can do that as follows: 


  1. Connect to your server using the method your normally use to upload files. Most people either use FTP or SFTP to do this. 
  2. Rename the Wordfence directory (or folder if you prefer). If your site has the standard WordPress structure, you can do this by simply renaming the following folder: wp-content/plugins/wordfence/  


The above procedure will immediately unlock your site. If you are still seeing a message that you’re locked out, make sure you disable any caching plugins like W3 Total Cache, or clear their cache. If you can’t access the site to disable the caching plugin, you may have to temporarily rename the caching plugin directory to disable it. You may also have to clear any caches on a front-end caching proxy if you have an advanced configuration. 

In the highly unusual case that you don’t have access to your own files on your server, you will need to log a support call with your web hosting company or whoever manages your server and ask them to rename the wp-content/plugins/wordfence folder.


How to reactivate Wordfence once you're regained access:


Once you have disabled Wordfence by renaming the folder, if you rename the folder back to the original name, you may be locked out again. Here is how you avoid this from happening:

  1. Don't rename the Wordfence folder back to the original name yet. 
  2. Install the Wordfence Assistant plugin. You can find it by going to Plugins and Add New. Then do a search for "wordfence assistant" without quotes. You can also find it on this page in the official Wordfence plugin repository
  3. Activate the plugin.
  4. Go to the "WF Assistant" menu.
  5. Click the button to disable the Wordfence firewall.
  6. Now you can rename the Wordfence folder back to the original name and you won't be locked out.
  7. Once Wordfence has been reactivated, disable the feature of Wordfence that locked you out. 
  8. Then reactivate the Wordfence firewall by going to the Wordfence options page and checking the box to activate the firewall and hit Save. 
  9. You can optionally uninstall the Wordfence Assistant plugin. 

Source: https://support.wordfence.com/support/solutions/articles/1000010693-i-ve-locked-myself-out-of-my-site-i-ve-tried-the-email-unlock-feature-and-it-didn-t-work-what-shoul