Title: Corrected commenter IP for Cloudflare CDN
Author: guguan123
Published: <strong>April 11, 2025</strong>
Last modified: August 9, 2025

---

Search plugins

![](https://s.w.org/plugins/geopattern-icon/cfcdn-comment-ip-fix.svg)

# Corrected commenter IP for Cloudflare CDN

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

[Download](https://downloads.wordpress.org/plugin/cfcdn-comment-ip-fix.0.1.4.zip)

 * [Details](https://test.wordpress.org/plugins/cfcdn-comment-ip-fix/#description)
 * [Reviews](https://test.wordpress.org/plugins/cfcdn-comment-ip-fix/#reviews)
 *  [Installation](https://test.wordpress.org/plugins/cfcdn-comment-ip-fix/#installation)
 * [Development](https://test.wordpress.org/plugins/cfcdn-comment-ip-fix/#developers)

 [Support](https://wordpress.org/support/plugin/cfcdn-comment-ip-fix/)

## Description

This WordPress plugin is designed to correct the inaccurate display of commenter
IP addresses on websites utilizing Cloudflare CDN. By processing proxy IPs from 
Cloudflare, this plugin ensures that the real commenter IP information is retrieved
and recorded. This is crucial for comment moderation, spam identification, and website
security analysis.

Please note: This plugin is provided by an independent developer and is not an official
Cloudflare product.

### Usage

 1. Ensure your WordPress website is correctly configured and proxied through Cloudflare
    CDN.
 2. Once activated, the plugin will automatically correct IP addresses in the following
    functionalities to display the real visitor IP:
 3.  * **User Comments:** The IP address recorded upon comment submission.
     * **Password Reset Emails:** The IP address included in password reset emails 
       sent to users.

This plugin requires no additional configuration; it works automatically upon activation.

### External Services

This plugin connects to the Cloudflare API to retrieve the latest list of Cloudflare
CDN IP addresses. This is necessary to ensure the plugin can accurately handle IP-
related functionalities, such as fixing comment IP detection when Cloudflare’s CDN
is in use.

### What the service is and what it is used for

The plugin uses the Cloudflare API (specifically the `https://api.cloudflare.com/
client/v4/ips` endpoint) to fetch the current list of Cloudflare CDN IP addresses.

### What data is sent and when

The plugin **does not send any user-specific data** to the Cloudflare API. It only
makes a simple GET request to the API endpoint to retrieve the IP list. This request
occurs when the plugin needs to refresh the IP list.

### Service provider

The service for retrieving Cloudflare IP lists is provided by Cloudflare, Inc..

### Links to terms of service and privacy policy

 * Terms of Service: https://www.cloudflare.com/terms/
 * Privacy Policy: https://www.cloudflare.com/privacypolicy/

The retrieval of this information (Cloudflare IP list) ensures the plugin functions
correctly with Cloudflare’s CDN services. No personal or sensitive user data is 
transmitted during this process.

### Libraries Used

 * **[IPLib](https://github.com/mlocati/ip-lib)**: Used for parsing and matching
   IP addresses.

## Installation

 1. Upload the `cfcdn-comment-ip-fix` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in your WordPress dashboard.

## FAQ

### Why do I need this plugin?

When your website uses Cloudflare CDN, all visitor IP addresses may be replaced 
by Cloudflare’s proxy IP addresses. This prevents you from obtaining accurate visitor
source information for comment management, user behavior analysis, or security auditing.
This plugin aims to correct these IP addresses, ensuring you get the real IP information
to better manage your website.

### Does the plugin support IPv6?

Yes, this plugin supports the retrieval and correction of IPv6 addresses.
 However,
for IP correction in **password reset emails**, the current optimization primarily
targets IPv4 addresses. If your website predominantly uses IPv6 for its origin server,
the IP correction functionality in emails might not fully cover IPv6 addresses. 
I am continuously improving this feature to provide more comprehensive IPv6 support.

### Does the plugin automatically update Cloudflare’s IP list?

Yes, the plugin automatically updates Cloudflare’s IP list daily to ensure it is
always current and accurate.

### Will the plugin affect my website’s performance?

This plugin is designed to operate without significantly impacting core website 
performance. It primarily corrects IP addresses in low-frequency scenarios such 
as user comment submissions and password reset email dispatches, thus not causing
a noticeable performance impact under normal traffic.

### Does this plugin support other CDNs?

Currently, this plugin **only supports Cloudflare CDN**. However, you can manually
add IP addresses from other CDNs. It retrieves the real IP via the X-Forwarded-For
header.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Corrected commenter IP for Cloudflare CDN” is open source software. The following
people have contributed to this plugin.

Contributors

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

[Translate “Corrected commenter IP for Cloudflare CDN” into your language.](https://translate.wordpress.org/projects/wp-plugins/cfcdn-comment-ip-fix)

### Interested in development?

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

## Changelog

#### 0.1.4

改进了国际化支持，更符合WordPress的要求

#### 0.1.3

 * Improved: Comprehensive formatting and content optimization of the `readme.txt`
   file to comply with WordPress.org standards.
 * Fixed: Correctly identify the real IP when the X-Forwarded-For request header
   contains multiple IPs.

#### 0.1.2

 * Added: IP address correction for password reset emails.
 * Improved: IPv6 support.

#### 0.1.1

 * Initial release.

## Meta

 *  Version **0.1.4**
 *  Last updated **9 months ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **6.8.5**
 *  PHP version ** 7.0 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/cfcdn-comment-ip-fix/)
 * Tags
 * [cdn](https://test.wordpress.org/plugins/tags/cdn/)[cloudflare](https://test.wordpress.org/plugins/tags/cloudflare/)
   [comments](https://test.wordpress.org/plugins/tags/comments/)[real ip](https://test.wordpress.org/plugins/tags/real-ip/)
   [security](https://test.wordpress.org/plugins/tags/security/)
 *  [Advanced View](https://test.wordpress.org/plugins/cfcdn-comment-ip-fix/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/cfcdn-comment-ip-fix/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/cfcdn-comment-ip-fix/reviews/)

## Contributors

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

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/cfcdn-comment-ip-fix/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://qr.alipay.com/fkx17591v9cegbc196ly4b3)