← WordPress Plugins
WordPress Plugin
Real IP Restore for Cloudflare
On many shared cPanel hosts, Apache does not natively restore the client IP from Cloudflare headers - so WordPress, WooCommerce, security plugins and access logs all record Cloudflare's edge IP instead of the real visitor. This plugin fixes that transparently, with zero configuration.
How it works
- On each request it checks whether
REMOTE_ADDRbelongs to an official Cloudflare IP range. - If - and only if - it does, it replaces it with the validated
CF-Connecting-IPvalue, so spoofed headers can't fake an IP. - Cloudflare's IP ranges are refreshed once a day from their official endpoints and cached, with a hardcoded fallback.
Features
- Zero configuration - works out of the box
- IPv4 and IPv6 support
- Daily auto-refresh of Cloudflare IP ranges
- Anti-spoofing: header trusted only behind a verified Cloudflare range
- Lightweight - no database tables, no options, no JavaScript