Working





WordPress

Plugins + Copy & Paste Sample Code

WordPress integration is as easy as installing a PHP Snippet plugin and pasting one block of code into it

Choose ONE of the compatible Plugins below

 

Plugin

Link

Instructions

✔

FluentSnippets

✔

Add Custom Codes

✔

WP Coder

✔

Code Snippets

✔

Woody Code Snippets

✔

Code Engine

⚠

WPCode Lite *

 

* May require WPCode PRO to protect shopping cart pages

✔

I'm using a different PHP Snippet Plugin

PHP

Copy & Paste Sample Code

PHP Requirements: NginX with php-fpm: PHP >= 7.3.0 OR any other web server with PHP >= 5.3

  • Copy the integration code into your PHP workflow (include or embed) and you're done
    • You can also copy the sample code to a file on your web server then hit it with
      a web browser to see the results
      • Includes real-time compatibility and connectivity checks
      • Provides instant solutions if there are any issues detected

⚠ You must be Signed in to view the code below

or

You must be Signed in to view the code

To test and verify the integration is successful

  • Wait until your site gets a hit OR
  • Access the front-end of your website to generate a hit
Check the Bot Blocker log

📖 API Documentation: Request

Field Sample Data Description
API_KEY Your API Key Goes Here API Key
CLIENT_IP 127.0.0.1 Client IPv4 or IPv6 used for the request
ALL_REQUEST_HEADERS 

User-Agent: badbot/1.0
Host: example.com
Referer: https://example.com/

 All request headers
Cookies are removed in sample code and also removed in the API end-point server side. No cookies are processed or stored.
REQUEST_URI /mypage Full URI of request
REMOTE_PORT 12345 Remote Port used for the request
SERVER_PROTOCOL HTTP/3 Server Protocol used for the request
REQUEST_METHOD GET Request Method used for the request
SERVER_PORT 443 Server Port used for the request
SERVER_DATE 2026-11-10 YYYY-MM-DD - So the Bot Blocker logs match your server logs
SERVER_TIME 11:22:33 HH:MM:SS - So the Bot Blocker logs match your server logs
HTTPS on off = HTTP, on = HTTPS

All of the fields above are JSON encoded into a single POST variable named "POST_DATA":

[POST_DATA] => {"API_KEY":"Your API Key Goes Here","CLIENT_IP":"127.0.0.1","ALL_REQUEST_HEADERS":{"User-Agent":"badbot/1.0","Host":"example.com","Referer":"https://example.com/"},"REQUEST_URI":"\/mypage","REMOTE_PORT":"12345","SERVER_PROTOCOL":"HTTP\/3","REQUEST_METHOD":"GET","SERVER_PORT":"443","SERVER_DATE":"2026-11-10","SERVER_TIME":"11:22:33","HTTPS":"on"}

📖 API Documentation: Reply

Field Sample Data Description
status F A = Allow, B = Block, E = API Error, F = Forward, I = Inactive Account
protocol_status 302 Protocol Status Code returned
user_status_msg Custom Rule: Rule Name Here Message describing status action
forward_to_url https://example.com/landing_page Present when status = F
plan_end_date 2027-11-10 Plan expires on this date (YYYY-MM-DD)
hits_left 15279 Number of hits left in plan until plan_end_date

Reply will be JSON encoded

{"status":"F","protocol_status":"302","user_status_msg":"Custom Rule: Rule Name Here","plan_end_date":"2027-11-10","hits_left":15279}