WordFence IP Whitelist Sync
A plugin designed to automatically maintain certain IP ranges in the whitelist of the WordPress security plugin WordFence.
by Kris Bailey · github.com/myfykris/wf-ip-whitelist-sync · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/myfykris/wf-ip-whitelist-sync/archive/refs/heads/main.zipAutomatically fetch and sync IP ranges from various services (like Google crawlers) to the WordFence whitelist.
Description
This plugin automatically maintains IP ranges in your WordFence whitelist by fetching the latest published IP range files from various services. It includes built-in support for Google's crawler IPs and can be extended to support any service that publishes their IPs in JSON, XML, or CSV format.
Features
- Automatic Syncing: Schedule automatic updates of IP ranges on hourly, daily, weekly, or monthly intervals
- Manual Sync: Run syncs manually with full preview and control
- Multiple Sources: Pre-configured with Google crawler IPs, easily add custom sources
- Format Support: Parses JSON, XML, and CSV formats
- IP Version Control: Support for both IPv4 and IPv6 addresses
- Global Filters: Set IPs to ignore, never add, or never remove
- Diff Preview: Review what will be added/removed before applying changes
- Statistics Dashboard: Track sync status and history
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- WordFence Security plugin (required)
Installation
- Upload the
wf-ip-whitelist-syncfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to "WF IP Sync" in the WordPress admin menu
- Configure your settings and review the pre-configured Google sources
Usage
Dashboard
View statistics about your sync sources and current settings. Quick access to:
- Run manual sync
- Manage sync sources
- Configure settings
Sync Sources
Manage your IP range sources:
- View all configured sources
- Add new sources
- Edit/delete existing sources
- See last fetch status and dates
Manual Sync
Three-step process for manual synchronization:
- Select Sources: Choose which sources to sync
- Preview Changes: Review what will be added/removed, edit if needed
- View Results: See the outcome of applied changes
Settings
Configure global behavior:
- Enable/disable automated syncing
- IPv4/IPv6 support
- Global ignore list
- Never remove list
- Never add list
Pre-configured Sources
The plugin comes with these Google crawler IP ranges pre-configured:
- Google Crawler Bots
- Google Special Case Crawlers (including ad bots)
- Google User Triggered Fetches
- Google Google Triggered Fetches
Adding Custom Sources
To add a custom IP source:
- Go to "WF IP Sync" → "Sync Sources"
- Click "Add New Sync Source"
- Fill in the details:
- Label: Display name
- Description: Optional details
- Status: Manual, Automatic, or Disabled
- URL: URL to the IP list file
- Format: JSON, XML, or CSV
- IP Format: CIDR notation or plain IPs
- IP Version: IPv4, IPv6, or both
- Remove Old Entries: Whether to remove IPs that are no longer in the source
- Sync Interval: How often to sync (for automatic sources)
Hooks & Filters
Actions
wfipws_before_fetch- Before fetching data from a sourcewfipws_after_fetch- After fetching data from a sourcewfipws_before_apply- Before applying changes to whitelistwfipws_after_apply- After applying changes to whitelistwfipws_sync_completed- After full sync process completes
Filters
wfipws_fetch_timeout- Modify HTTP request timeout (default: 30s)wfipws_parsed_ips- Modify parsed IP list before applyingwfipws_removal_list- Modify IPs to remove before applyingwfipws_addition_list- Modify IPs to add before applying
Development
File Structure
wf-ip-whitelist-sync/
├── wf-ip-whitelist-sync.php # Main plugin file
├── uninstall.php # Cleanup on uninstall
├── includes/ # PHP classes
│ ├── class-database.php
│ ├── class-sync-source.php
│ ├── class-settings.php
│ ├── class-ip-normalizer.php
│ ├── class-fetcher.php
│ ├── class-parser.php
│ ├── class-diff-calculator.php
│ ├── class-whitelist-manager.php
│ ├── class-cron.php
│ └── class-admin.php
├── admin/ # Admin page templates
│ ├── dashboard.php
│ ├── settings.php
│ ├── sync-sources.php
│ ├── sync-source-edit.php
│ ├── manual-sync-step1.php
│ ├── manual-sync-step2.php
│ └── manual-sync-step3.php
└── assets/ # CSS and JavaScript
├── css/admin.css
└── js/admin.js
License
Apache License 2.0
Author
Kris Bailey kris@krisbailey.com
Repository
https://github.com/myfykris/wf-ip-whitelist-sync
Support
For issues and feature requests, please use the GitHub issue tracker.