WP-Ban
Ban users by IP, IP range, host name, user agent and referrer URL from visiting your WordPress blog.
The facts
- Rating
- 3.7★ from 27
- Active installs
- 8k+
- Price
- Free
- Last updated
- 9 Aug 2026
- Added
- Jan 2007
- Requires WP
- 6.8
- Tested up to
- WP 7.0.4
- Requires PHP
- 8.2
- Downloads
- 330,695
Our analysis
AI-assistedWP-Ban is a WordPress plugin that allows you to ban visitors from your site based on various criteria such as IP address, host name, user agent, or referrer URL. It provides a custom message to banned visitors and includes features like wildcards for matching and an exclude list that takes precedence over other bans.
The plugin is configured through a settings interface with three tabs: Stats for tracking attempts, Settings for managing ban lists, and Templates for customising the banned message. It also includes self-ban protection to prevent users from locking themselves out of their own site.
Best for: This plugin is suitable for website administrators looking to manage access to their site by banning specific visitors.
What it does well
- ✓Bans visitors by IP, host name, user agent, or referrer URL
- ✓Supports wildcards for flexible matching
- ✓Includes an exclude list to prevent certain addresses from being banned
- ✓Provides a customisable HTML message for banned visitors
- ✓Tracks the number of attempts by banned visitors
Where it falls short
- •Limited information on user experience or support
- •No detailed feature list beyond the author's description
Verdict
WP-Ban offers a straightforward solution for banning visitors based on various criteria, though details on user experience and support are not provided.
From the developer
Lester Chan's own description of WP-Ban, lightly tidied.
Banned visitors are served a custom message instead of your site. You can ban by IP address, IP range, host name, user agent or referrer URL, exclude specific addresses from ever being banned, and see how many times each banned visitor has tried to get in. Wildcards are supported throughout.
Everything is configured under Settings -> Ban, on three tabs: Stats for the attempt counters, Settings for the ban lists and the visitor IP options, and Templates for the banned message. The plugin will not let you ban the address, host name or user agent you are currently browsing with, so a wildcard that would lock you out of your own site is refused at save time and the screen says which entry it dropped.
Features
- Ban by IP address, IP range, host name, user agent or referrer URL
- Wildcards in every list except IP ranges and the exclude list
- IPv4 and IPv6, including IPv6 ranges
- An exclude list that wins over every other list
- Your own banned message, as a complete HTML document, with a live preview
- A sortable, paginated count of how many times each banned visitor has tried
- Self-ban protection that protects whoever is saving, not just a user called “admin”
Donations
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
Usage
Go to Settings -> Ban. The screen has three tabs and opens on Stats.
On the Settings tab, fill in the lists you want. Every list matches the whole value, so use * where you want a partial match: 192.168.1.* bans that whole block, EmailSiphon* bans every user agent starting with that name.
IP ranges are written as start-end, one per line. IPv4 and IPv6 are both supported, but a single range cannot mix the two.
The Templates tab holds the banned message on its own, because it is a whole HTML document and burying it under six textareas made the screen a wall.
The Stats tab is the attempt counters, twenty rows at a time, sortable by address or by attempts. Tick the rows you want cleared and use the bulk action, or tick Reset every IP ban stat and the total to start again.
All three tabs write the same wp_ban_options row, so saving one never disturbs what the other two hold.
Wp-cli
wp ban list
wp ban list ips
wp ban add ips 192.168.1.100
wp ban add ips '192.168.1.*'
wp ban add ips_range 192.168.1.1-192.168.1.255
wp ban remove ips 192.168.1.100 --yes
wp ban check 192.168.1.55
wp ban stats
wp ban reset --all --yes
The lists are ips, ips_range, hosts, referers, user_agents and exclude_ips — the same six the Settings tab shows, in the same order. Quote any entry containing a *, or the shell will try to expand it into filenames.