Title: Invalid Traffic Blocker
Author: Michael Akinwumi
Published: <strong>April 16, 2025</strong>
Last modified: October 26, 2026

---

Search plugins

![](https://ps.w.org/invalid-traffic-blocker/assets/banner-772x250.png?rev=3765933)

![](https://ps.w.org/invalid-traffic-blocker/assets/icon-256x256.png?rev=3765933)

# Invalid Traffic Blocker

 By [Michael Akinwumi](https://profiles.wordpress.org/maocular/)

[Download](https://downloads.wordpress.org/plugin/invalid-traffic-blocker.1.5.0.zip)

 * [Details](https://srd.wordpress.org/plugins/invalid-traffic-blocker/#description)
 * [Reviews](https://srd.wordpress.org/plugins/invalid-traffic-blocker/#reviews)
 *  [Installation](https://srd.wordpress.org/plugins/invalid-traffic-blocker/#installation)
 * [Development](https://srd.wordpress.org/plugins/invalid-traffic-blocker/#developers)

 [Support](https://wordpress.org/support/plugin/invalid-traffic-blocker/)

## Description

Invalid Traffic Blocker is a WordPress plugin that uses the IPHub.info API to detect
and block unwanted traffic such as bots, VPNs, and suspicious IP addresses. This
helps AdSense publishers and website owners ensure that only valid traffic is served.
This is not an official plugin for IPHub.info.

This plugin is complete and free to use, with no locked features. If you also run
sites that aren’t built on WordPress, [IVTB](https://ivtb.uk/) is the enterprise
version of Invalid Traffic Blocker for other platforms.

### External Services

This plugin connects to the IPHub.info API (https://v2.api.iphub.info) to validate
IP addresses and determine whether they are suspicious, likely belonging to bots,
VPNs, or invalid traffic. All requests use HTTPS.
 Data transmitted: • The visitor’s
IP address, each time a visitor is checked and no cached result exists. • The admin’s
own IP address, when the “Test API Connectivity” button is clicked on the settings
page. • Your IPHub API key, in a request header with each lookup. Purpose: • To 
determine the nature of the IP (e.g., non‑residential, residential suspicious) and
decide whether to block access. Terms and Privacy: • IPHub.info Terms of Service:
https://iphub.info/legal/tos • IPHub.info Privacy Policy: https://iphub.info/legal/
privacy

When “Allow Known Crawlers” is enabled, a visitor whose User-Agent claims to be 
a known search engine crawler is verified with a reverse and forward DNS lookup 
through your server’s own DNS resolver. Nothing is sent to IPHub.info or any other
service for this check.

## Screenshots

[⌊Connect IPHub: add your API key (hidden by default), see whether protection is
active, and test the saved connection.⌉⌊Connect IPHub: add your API key (hidden 
by default), see whether protection is active, and test the saved connection.⌉[

Connect IPHub: add your API key (hidden by default), see whether protection is active,
and test the saved connection.

[⌊Protection rules: turn protection on and choose Safe, Strict or Custom blocking
mode.⌉⌊Protection rules: turn protection on and choose Safe, Strict or Custom blocking
mode.⌉[

Protection rules: turn protection on and choose Safe, Strict or Custom blocking 
mode.

[⌊Trusted visitors and crawlers: whitelist IP addresses, let verified search engine
crawlers through, and add your own crawler patterns.⌉⌊Trusted visitors and crawlers:
whitelist IP addresses, let verified search engine crawlers through, and add your
own crawler patterns.⌉[

Trusted visitors and crawlers: whitelist IP addresses, let verified search engine
crawlers through, and add your own crawler patterns.

[⌊Network and performance: choose where the visitor IP is read from, see the IP 
the plugin detects, and set how long results are cached.⌉⌊Network and performance:
choose where the visitor IP is read from, see the IP the plugin detects, and set
how long results are cached.⌉[

Network and performance: choose where the visitor IP is read from, see the IP the
plugin detects, and set how long results are cached.

[⌊The page a visitor sees when their IP address is blocked.⌉⌊The page a visitor 
sees when their IP address is blocked.⌉[

The page a visitor sees when their IP address is blocked.

## Installation

 1. Upload the plugin files to the `/wp-content/plugins/invalid-traffic-blocker` directory
    or install the plugin through the WordPress plugins screen.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Navigate to `Settings > Invalid Traffic Blocker` in your WordPress admin dashboard.
 4. Enter your IPHub API key, choose your desired blocking mode, and add any trusted
    IP addresses to the whitelist.
 5. Save your settings and use the “Test API Connectivity” and “Whitelist My IP” buttons
    as needed.

## FAQ

### What is Invalid Traffic Blocker?

Invalid Traffic Blocker is a WordPress plugin that uses the IPHub.info API to detect
and block unwanted traffic, including bots, VPNs, and suspicious IP addresses. It
helps ensure that only valid traffic reaches your website.

### How do I configure the plugin?

After activating the plugin, go to `Settings > Invalid Traffic Blocker`. Here you
can enter your API key, select a blocking mode, and manage your IP whitelist.

### What if my API key is missing or invalid?

If the API key is missing or incorrect, the plugin will not perform any blocking.
Make sure to obtain a valid API key from [IPHub.info](https://iphub.info/register).

### Can I update the whitelist later?

Yes, you can update the list of whitelisted IP addresses at any time from the settings
page.

### How do I whitelist my IP?

Click the “Whitelist My IP” button on the settings page to add your current IP address
to the whitelist, then click “Save Changes”.

### My site is behind Cloudflare, a CDN or a proxy. Which Visitor IP Source should I use?

Leave it on “Automatic” if you use Cloudflare, or a proxy on your own server or 
private network. If requests reach your site through another CDN, firewall or load
balancer that adds an X-Forwarded-For header, choose “Reverse proxy or load balancer”.
The settings page shows which IP the plugin sees for your own request, so you can
check that it matches your real IP.

### Can a bot get past the blocker by pretending to be Googlebot?

No. With “Allow Known Crawlers” enabled, Googlebot, Bingbot, Yahoo Slurp, Baiduspider
and YandexBot are confirmed with a reverse DNS lookup. A visitor who only fakes 
the User-Agent is checked like everyone else. Patterns you add under “Additional
Crawler Patterns” are not verified, so only add crawlers you need.

## Reviews

![](https://secure.gravatar.com/avatar/cd82424a98488b7571da454b6006896d1df96042997073f5875a5c215d0589f3?
s=60&d=retro&r=g)

### 󠀁[Best option to block bad IP](https://wordpress.org/support/topic/best-option-to-block-bad-ip/)󠁿

 [mrcode98](https://profiles.wordpress.org/mrcode98/) May 26, 2025

i like this plugin is so easy to use and block all bad IPs

 [ Read all 1 review ](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/)

## Contributors & Developers

“Invalid Traffic Blocker” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Michael Akinwumi ](https://profiles.wordpress.org/maocular/)

[Translate “Invalid Traffic Blocker” into your language.](https://translate.wordpress.org/projects/wp-plugins/invalid-traffic-blocker)

### Interested in development?

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

## Changelog

#### 1.5.0

 * Refreshed the settings page with responsive sections, saved configuration status,
   a masked API key, inline whitelist feedback, and API test loading/error states.
   Assets are local and load only on the plugin settings page.
 * Added clear IPHub data-sharing guidance beside setup. Existing option names and
   visitor blocking behavior are preserved.

#### 1.4

 * Security: The visitor IP is now read from the direct connection. Proxy headers(
   X-Forwarded-For, CF-Connecting-IP) are only trusted when the request comes from
   Cloudflare or a private network address, or when you choose them in the new “
   Visitor IP Source” setting. Previously any visitor could fake their IP to skip
   the check or use up your API quota.
 * Security: “Allow Known Crawlers” now confirms crawlers with a reverse DNS lookup,
   so a faked crawler User-Agent no longer skips the check. DuckDuckBot was removed
   from the built-in list because it can’t be verified this way; add it under “Additional
   Crawler Patterns” if you need it.
 * Security: IPHub API requests now use HTTPS, so your API key and visitor IPs are
   no longer sent in plain text.
 * Fix: The first save of the settings could reset them to Safe Mode, turn on “Allow
   Known Crawlers” and show a “Please select only one blocking mode” error.
 * Fix: “Allow Known Crawlers” never matched on hosts that run PHP as CGI/FastCGI.
 * Fix: WP-Cron, WP-CLI and the login page are no longer checked, so scheduled tasks
   keep running and admins on a VPN can still sign in.
 * Fix: When the IPHub API fails or rate-limits requests, lookups pause for 5 minutes
   instead of slowing down every page view.
 * Change: “Additional Crawler Patterns” are now plain-text, case-insensitive matches
   instead of regular expressions. Patterns containing “/” used to cause PHP warnings
   on every page. Remove regex symbols such as ^ or $ from existing entries.
 * Change: The blocking mode is now a single choice with Safe Mode as the default.
   Sites that had the plugin enabled with no mode ticked now block in Safe Mode.
   Custom Mode with no block types ticked no longer makes API calls.
 * The settings page shows which IP the plugin sees for your request, and warns 
   when proxy headers are being ignored.
 * Added a link to IVTB, the enterprise version for non-WordPress sites, on the 
   settings page and the Plugins screen.
 * Tested up to WordPress 7.1.

#### 1.3

 * Added “Allow Known Crawlers” setting to automatically bypass IP checks for common
   search engine bots (Googlebot, Bingbot, Slurp, DuckDuckBot, Baiduspider, YandexBot).
 * Introduced “Additional Crawler Patterns” textarea so admins can specify extra
   User-Agent regexes to whitelist.
 * Updated `invatrbl_check_visitor_ip()` to use `filter_input()` and `sanitize_text_field()`
   when reading `$_SERVER['HTTP_USER_AGENT']` to comply with WP security standards.
 * Ensured User-Agent checks are fully sanitized to eliminate any `InputNotSanitized`
   warnings during plugin review.
 * Streamlined front-end blocking logic so known crawlers (built-in or custom) are
   skipped before performing IPHub API lookups.
 * Minor code refactoring and cleanup to align with WordPress Plugin Coding Standards.

#### 1.2

 * Use admin’s current IP for API testing instead of a default.
 * Fancy info boxes for API test responses (green for success, red for errors).
 * “Whitelist My IP” button to add the admin’s current IP to the whitelist automatically.

#### 1.1

 * added whitelist functionality and basic API connectivity testing.
 * introduced multiple blocking modes.

#### 1.0

 * Initial release with core functionality:
    - Integration with IPHub.info API.
    - Multiple blocking modes: Safe, Strict, and Custom.
    - Persistent warning message for blocked users.
    - Basic security measures and caching implementation.

## Meta

 *  Version **1.5.0**
 *  Last updated **3 weeks ago**
 *  Active installations **40+**
 *  WordPress version ** 4.5 or higher **
 *  Tested up to **7.1.4**
 *  PHP version ** 7.2 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/invalid-traffic-blocker/)
 * Tags
 * [adsense](https://srd.wordpress.org/plugins/tags/adsense/)[blocker](https://srd.wordpress.org/plugins/tags/blocker/)
   [invalid traffic](https://srd.wordpress.org/plugins/tags/invalid-traffic/)[ip](https://srd.wordpress.org/plugins/tags/ip/)
   [vpn](https://srd.wordpress.org/plugins/tags/vpn/)
 *  [Advanced View](https://srd.wordpress.org/plugins/invalid-traffic-blocker/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/invalid-traffic-blocker/reviews/)

## Contributors

 *   [ Michael Akinwumi ](https://profiles.wordpress.org/maocular/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/invalid-traffic-blocker/)