BBQ Pro enables you to block just about anything: bad strings, malicious requests, user agents, IP addresses, and more. But what happens if you accidentally block yourself, so that you can’t access your own site? This guide explains how to restore access with a quick modification to the BBQ options in the WordPress database.
Ways to block yourself
There are a few ways to accidentally lock yourself out of your website. Do NOT do any of these things:
- Add the WP Login Page URI to the Request URI patterns
- Add something like
/
or.php
to the Request URI patterns - Add your user agent (or part of it) to the User Agent patterns
- Add your IP address (or part of it) to the IP Address patterns
If any of these happen, you can restore access by accessing your WP database and making a small change to the BBQ options.
How to restore access
If you get blocked by some custom firewall pattern and need to restore access, there are two ways to do it:
- Delete BBQ patterns via the database (easiest)
- Disable BBQ patterns via the database (not as easy)
Let’s go through each of these techniques..
Delete patterns
The first method (deleting patterns) is fast and easy. The only downside is that you lose your firewall configuration. If you are using the default patterns and have not made any changes, then this method of restoring access is the way to go. Here are the steps:
- Make a backup of your database (just in case)
- Find and delete
bbq_patterns
in the WP options table
Done. BBQ Pro no longer is blocking any requests to your site, so you have full access. After restoring access using this technique, BBQ Pro is still active and using the default set of firewall patterns.
Disable patterns
The second method (disabling patterns) requires precision and editing of the BBQ options in the database. This method of restoring access is recommended if you have customized your firewall patterns. Going this route means that you won’t lose any configuration. Here are the steps:
- Make a backup of your database (just in case)
- Find
bbq_options
in the WP options table
Once you have the bbq_options
, the goal is to change the active status to 0
for each set of BBQ patterns (Basic, Advanced, and Custom). So assuming that all patterns are enabled in the BBQ settings, bbq_options
will include the following strings:
s:11:"basic_rules";i:1;
s:14:"advanced_rules";i:1;
s:12:"custom_rules";i:1;
Notice where it says i:1
(three instances). The 1
is a boolean value that means “true” or enabled. Because each of the patterns (Basic, Advanced, Custom) are enabled in the settings, they each have a i:1
in the BBQ option.
Now to restore site access, simply change each of the three i:1
to i:0
. Because i:0
means “false”, changing all three patterns to 0
will disable the firewall completely. So make sure the three patterns are disabled, like so:
s:11:"basic_rules";i:0;
s:14:"advanced_rules";i:0;
s:12:"custom_rules";i:0;
Save changes and done. All BBQ Pro patterns now are disabled, so you will have access to your website. This is the quickest way to restore access without losing any custom firewall patterns.