BBQ Pro makes it possible to customize the response for blocked requests. This quick tutorial explains how to do it via the plugin settings.
Default blocked message
By default, when BBQ blocks a bad request, it exits and returns a “403 Forbidden” status code. So any blocked bot or user simply will get a message that says “403 Forbidden”, depending on which status code you are sending. The response deliberately is kept as small as possible for performance optimization.
Custom blocked message
If you would like to display a custom message for blocked requests, you can enter it via the plugin setting, “Custom Message”. The custom message can include any text and/or basic HTML/markup.
Inside of the custom message setting, you can use these shortcodes:
%s = Display the matching pattern
%c = Display the blocked count
Here is an example custom message that shows the matching pattern:
Request denied. Reason: detected forbidden pattern %s in the request.
So then if a bot or user makes a request that contains some forbidden string, like eval(
for example, the response message will look like this:
Request denied. Reason: detected forbidden pattern eval( in the request.
Note that you also can set a custom response status via the plugin setting, “Status Code”.