Title: Block Logins with Cloudflare
Author: supersoju
Published: <strong>March 23, 2026</strong>
Last modified: March 27, 2026

---

Search plugins

![](https://ps.w.org/block-logins-cf/assets/icon-256x256.png?rev=3489069)

# Block Logins with Cloudflare

 By [supersoju](https://profiles.wordpress.org/supersoju/)

[Download](https://downloads.wordpress.org/plugin/block-logins-cf.1.1.zip)

 * [Details](https://wordpress.org/plugins/block-logins-cf/#description)
 * [Reviews](https://wordpress.org/plugins/block-logins-cf/#reviews)
 *  [Installation](https://wordpress.org/plugins/block-logins-cf/#installation)
 * [Development](https://wordpress.org/plugins/block-logins-cf/#developers)

 [Support](https://wordpress.org/support/plugin/block-logins-cf/)

## Description

**Block Logins with Cloudflare** helps protect your WordPress site from brute-force
attacks by blocking IPs at the Cloudflare firewall after a configurable number of
failed login attempts.

 * Block IPs via Cloudflare after X failed login attempts
 * Block IPs that generate excessive 404 responses (bots and scanners)
 * Block IPs attacking via XML-RPC with intelligent detection
 * Automatic unblocking after a configurable duration
 * Whitelist IPs to never block or track them (supports IPv6 CIDR ranges)
 * View and manually unblock blocked IPs from the admin
 * Block source tracking — see whether each IP was blocked via login, XML-RPC, or
   404
 * Sync existing Cloudflare blocks into the local blocked IPs list
 * Secure settings page with Cloudflare API token validation
 * Hourly cron job for automatic maintenance

### External Services

This plugin relies on the **Cloudflare API** to function. It communicates with Cloudflare’s
external servers to block IP addresses at the firewall level.

**What is the Cloudflare API and what is it used for?**
 The Cloudflare API is a
RESTful service provided by Cloudflare, Inc. that allows programmatic management
of Cloudflare firewall rules. This plugin uses it to automatically block and unblock
IP addresses based on failed login attempts, XML-RPC attacks, and 404 scanning activity.

**What data is sent and when?**
 The plugin sends the following data to Cloudflare’s
API servers:

 1. **During settings validation** (when you save Cloudflare credentials):
 2.  * Your Cloudflare API token (for verification)
     * Endpoint: `https://api.cloudflare.com/client/v4/user/tokens/verify`
 3. **When blocking an IP** (after a threshold is reached):
 4.  * The IP address to be blocked
     * Your Cloudflare email address and API key/token
     * Your Cloudflare Zone ID
     * A note describing the reason for the block
     * Endpoint: `https://api.cloudflare.com/client/v4/zones/{zone_id}/firewall/access_rules/
       rules`
 5. **When syncing from Cloudflare** (on demand):
 6.  * Fetches existing firewall rules from your Cloudflare zone
     * Endpoint: `https://api.cloudflare.com/client/v4/zones/{zone_id}/firewall/access_rules/
       rules`

No personally identifiable information about your WordPress users is transmitted.
Only IP addresses are sent to Cloudflare.

**Service provider information:**
 – Service: Cloudflare API – Provider: Cloudflare,
Inc. – Terms of Service: https://www.cloudflare.com/terms/ – Privacy Policy: https://
www.cloudflare.com/privacypolicy/ – API Documentation: https://developers.cloudflare.
com/api/

**Required for functionality:**
 This plugin requires a Cloudflare account and will
not function without valid Cloudflare API credentials. The external API calls are
essential to the plugin’s core functionality.

### License

GNU General Public License v2 or later

## Installation

 1. Upload the plugin files to the `/wp-content/plugins/block-logins-cf` directory,
    or install through the WordPress plugins screen.
 2. Activate the plugin through the ‘Plugins’ screen.
 3. Go to **Block Logins CF** in the admin sidebar to configure your Cloudflare credentials
    and settings.

## FAQ

### What permissions does my Cloudflare API token need?

Your token needs `Zone.Zone` and `Zone.Firewall` permissions for the relevant zone.

### Where do I find my Cloudflare Zone ID?

In your Cloudflare dashboard, select your domain and look for the Zone ID in the
Overview tab.

### Does this block at the Cloudflare level or just WordPress?

This plugin blocks IPs at the Cloudflare firewall, stopping attacks before they 
reach your server.

### What does 404 blocking protect against?

It detects bots and vulnerability scanners that probe your site by requesting many
non-existent URLs. When an IP exceeds the configurable 404 threshold, it is blocked
via Cloudflare just like a brute-force login attacker.

### Can I sync blocks I already have in Cloudflare?

Yes. Use the “Sync from Cloudflare” button on the Blocked IPs page to import existing
Cloudflare firewall rules into the plugin’s local list.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Block Logins with Cloudflare” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ supersoju ](https://profiles.wordpress.org/supersoju/)

[Translate “Block Logins with Cloudflare” into your language.](https://translate.wordpress.org/projects/wp-plugins/block-logins-cf)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/block-logins-cf/), 
check out the [SVN repository](https://plugins.svn.wordpress.org/block-logins-cf/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/block-logins-cf/)
by [RSS](https://plugins.trac.wordpress.org/log/block-logins-cf/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1

 * Added 404-based IP blocking to detect and block bots and vulnerability scanners
 * Added XML-RPC protection with intelligent attack detection
 * Added block source tracking — blocked IPs now show whether they were blocked 
   via login, XML-RPC, or 404
 * Added 404 activity log in the Blocked IPs admin page
 * Added “Sync from Cloudflare” to import existing Cloudflare firewall rules into
   the local list
 * Added IPv6 CIDR range support in the IP whitelist
 * Added caching for Cloudflare API token validation to prevent throttling

#### 1.0

 * Initial release

## Meta

 *  Version **1.1**
 *  Last updated **1 week ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **7.0**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [Brute Force](https://wordpress.org/plugins/tags/brute-force/)[cloudflare](https://wordpress.org/plugins/tags/cloudflare/)
   [firewall](https://wordpress.org/plugins/tags/firewall/)[login](https://wordpress.org/plugins/tags/login/)
   [security](https://wordpress.org/plugins/tags/security/)
 *  [Advanced View](https://wordpress.org/plugins/block-logins-cf/advanced/)

## Ratings

No reviews have been submitted yet.

[Add my review](https://wordpress.org/support/plugin/block-logins-cf/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/block-logins-cf/reviews/)

## Contributors

 *   [ supersoju ](https://profiles.wordpress.org/supersoju/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/block-logins-cf/)