Configuring Captcha WAF Protection in cPFence

The new Captcha WAF module provides one-click, server-level CAPTCHA protection for your login pages. Bots are intercepted offsite—no user interaction required.

Key Benefits:

  • Blocks automated brute‑force, dictionary, and credential‑stuffing bots
  • No impact on real user experience
  • Instant, server-wide or per-domain enable/disable
  • Supports all popular CMS and custom login URLs
  • Silent, offsite interception reduces server load

Using the WebUI

  1. Open the cPFence WebUI on your Main Control Panel server and select WAF Management.
  2. In the WAF Global Toggle section, click Captcha WAF (Global) to enable or disable server-wide protection.
  3. In the WAF Controls section, click Captcha WAF for Domain, enter your domain (e.g., a.com) and click the button to enable or disable per-domain protection.
  4. To customize protected paths, go to Edit Configuration FilesEdit Captcha Protected URLs. From there, add or remove any login paths you want protected, or edit /opt/cpfence/app/cpfwaf/userdata_login_pages directly.

Restart the Web Server

To apply these changes, restart your web server:

systemctl restart nginx.service
systemctl restart apache2.service
systemctl restart lshttpd.service

CLI Options

cpfence --enable-captcha-waf-domain DOMAIN
cpfence --disable-captcha-waf-domain DOMAIN
cpfence --enable-captcha-waf-global
cpfence --disable-captcha-waf-global

Replace DOMAIN with your actual domain name.

LiteSpeed Cache Compatibility

WP‑AutoShield now automatically disables LiteSpeed cache on login pages when Captcha WAF is active. To manage this manually, use:

cpfence --bulk-disable-ls-cache-login-page
cpfence --bulk-enable-ls-cache-login-page

Configuration File Option

You can also set this option in /opt/cpfence/config.conf:

autoshield_disable_ls_cache_login_page

Disables LiteSpeed cache on login pages for every WordPress site daily. (Recommended when using cPFence WAF Captcha)


Need Further Assistance?

If you encounter any issues or need additional help, feel free to reach out to our support team via your client portal.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why my custom WAF rules are not working?

If your custom ModSecurity rules aren’t taking effect, it’s often due to duplicate rule IDs or...

How to Block or Whitelist Certain User Agents ?

This guide will help you block or whitelist specific user agents in cPFence. You can manage these...

How to Enable / Disable WAF Rule by ID ?

This guide provides instructions for enabling and disabling specific WAF (Web Application...

How to Enable / Disable WAF?

The cPFence Web Application Firewall (WAF) now fully supports Apache, Nginx, OLS, and LSWS web...

How to Identify Problematic WAF Rule IDs in cPFence?

New! You can now use an automatic tracking tool to identify problematic WAF rules in real time....