Skip to content

Bot protection for WordPress

Install the Centinel plugin, enter your keys and choose what to cover: front-end pages, the REST API, login or gated uploads.

How it fits into WordPress

Requirements
WordPress 5.6+ (tested up to 6.9) and PHP 8.0+, installed from a plugin ZIP.
Protected areas
Front-end pages, the WP REST API, login attempts and an optional gate for /wp-content/uploads/*.
Timeout and failure mode
The validator call times out after 3 seconds and fails open.
Browser script
Loaded for you with async in <head> on WordPress 6.3+, and in the footer on 5.6 to 6.2.

How a request moves through WordPress

The plugin runs inside WordPress, so it sees every request that reaches PHP and none that a page cache answers first.

  1. Hook

    Front-end protection runs on template_redirect. With the uploads gate on, a rewrite sends /wp-content/uploads/* to WordPress with ca_uploads_file.

  2. Path rules

    An excluded path skips the validator call. If included paths are set and none match, the request is skipped. Everything else is checked.

  3. Decision

    Allow passes through. Block returns a 403 block page on the front end, 403 JSON on the REST API and a login error on login.

  4. Failure

    If the validator does not answer within 3 seconds, WordPress serves the request as usual.

Minimal configuration and a live check

Install with WP-CLI

terminal
wp plugin install /path/to/centinel-analytica-wordpress.zip --activate

Then open Settings, Centinel Analytica, enter the Site Key and Secret Key, and choose the areas to protect.

Check the script and the traffic view

Verify
curl -s https://example.com/ | grep -c whenCentinelReady

Expect 1 or more, which shows the plugin injected the collector script. Then confirm protected requests appear under Centinel Analytica, Analytics in the WordPress admin.

Deployment options

  • Upload in the WordPress admin

    Upload centinel-analytica-wordpress.zip under Plugins, Add New, Upload Plugin, activate it and configure it under Settings, Centinel Analytica.

    WordPress install guide (opens in a new tab)
  • Uploads gate on Apache, nginx or IIS

    Turn on Uploads directory to check files under /wp-content/uploads/*. Apache and LiteSpeed get an .htaccess rule; nginx and IIS need the rewrite from the settings panel.

    Uploads protection guide (opens in a new tab)

What to know before deploying

  • Page caches answer before the plugin runs

    WP Super Cache, W3 Total Cache, LiteSpeed Cache, WP Rocket and host Varnish serve cached pages before template_redirect. Exclude protected pages from the cache or protect them at the edge.

  • Login protection covers login attempts only

    The Login option checks login attempts. It does not check later requests to /wp-admin/.

  • Use full URL paths in path rules

    /uploads/* does not match files in /wp-content/uploads/; write /wp-content/uploads/*.pdf. Excluded paths always win over included paths.

  • nginx in front of Apache skips the uploads rule

    On Cloudways, Plesk or cPanel with nginx, nginx serves uploads directly and the panel shows Not protected. Ask your host to send /wp-content/uploads/ to Apache.

  • Your theme, other plugins and cache compatibility
  • Requests to /wp-admin/ after login
  • Public uploads outside the paths you gate
  • WooCommerce checkout logic and membership eligibility checks

WordPress integration questions

Walk through your WordPress setup

Bring one route bots are hitting. We will map the right connector, timeouts, and log-only rollout for your WordPress stack.