Create your own patterns to block bots that aren’t in the catalog
The default catalog covers the most common bots, but the internet is full of crawlers. Maybe a new AI startup is hitting your site, or a competitor built a custom scraper. Custom bot patterns let you block anything with a User-Agent string.
🎯
Custom Patterns
Navigate to WhoKnew Views → Admin, expand the 🤖 Bot Traffic Filter panel, and find the Add Custom Bot Pattern input field below the catalog.
📝 How to Add a Custom Pattern
1
Type Your Pattern
Enter a text string that appears in the bot’s User-Agent header. This can be a full name like NewAIBot or a partial match like scraper.
2
Click “➕ Add Pattern”
The pattern is validated (max 200 characters) and checked for duplicates. If valid, it’s immediately added to your active filter list.
3
Instant Activation
No save button needed, no cache clearing required. Your pattern starts blocking matching bots immediately on the next page request.
🖥️ Interface Preview
➕ Add Pattern
Enter a User-Agent pattern: The filter will match if this string appears anywhere in the visitor’s User-Agent header (case-insensitive).
🔤 Pattern Matching Rules
Understanding how pattern matching works is crucial for writing effective filters:
🔍
Substring Matching
Your pattern can appear anywhere in the User-Agent string. Bot will match MyCustomBot/1.0.
🔠
Case-Insensitive
googlebot matches Googlebot, GOOGLEBOT, and GoogleBot. No need to worry about capitalization.
📏
Exact Substring
No regex, no wildcards—just plain text matching. The pattern must appear exactly as typed (minus case).
📝
200 Character Max
Patterns must be under 200 characters. This is plenty—most bot identifiers are under 30 characters.
💻 Technical Implementation
// How WhoKnew Views™ checks patterns:
function wkv_user_agent_matches_pattern($user_agent, $pattern) {
// Case-insensitive substring search
return stripos($user_agent, $pattern) !== false;
}Uses PHP’s stripos() function—finds your pattern anywhere in the User-Agent string, ignoring case.
✅ Pattern Examples: Good vs. Bad
| Pattern | Status | Explanation |
|---|---|---|
| DataForSeoBot | ✅ GOOD | Specific bot name—targeted and safe |
| ZoomInfoBot | ✅ GOOD | B2B data company crawler—highly specific |
| PriceSpider | ✅ GOOD | Competitor price monitoring tool—clear target |
| Chrome | ❌ BAD | Would block ALL Chrome browsers—nearly every real customer! |
| Mozilla | ❌ BAD | Present in almost EVERY browser User-Agent—catastrophic false positives |
| Windows | ❌ BAD | Would block all Windows users from being tracked |
| HeadlessChrome | ✅ GOOD | Specific to headless browser automation, won’t affect real Chrome |
| Applebot | ⚠️ OKAY | Apple’s Siri/Spotlight crawler—specific but may affect Apple Search features |
🚨 Critical Rule: Never use common browser strings (Chrome, Safari, Firefox, Mozilla, Windows, Mac) as patterns. These appear in real customer User-Agents and would block legitimate traffic.
🔎 How to Find Bot User-Agent Strings
When you spot suspicious traffic patterns, here’s how to identify the bot and create a filter:
📋 Method 1: Server Access Logs
Your server logs every request including User-Agent strings. Check with your hosting provider or access logs directly:
# Example log entry:
192.168.1.1 - - [06/Jan/2025:10:23:45 +0000] "GET /product/widget/ HTTP/1.1" 200
"-" "DataForSeoBot (https://dataforseo.com/dataforseo-bot)"
↑
This is the User-Agent string - use "DataForSeoBot" as your pattern📋 Method 2: Google Analytics (or similar)
In GA4 or other analytics platforms, check the Tech → Browser report for unusual entries. Bots often appear with:
- Very low session duration (0-1 seconds)
- 100% bounce rate
- Strange browser names you don’t recognize
- High volume from a single “browser”
📋 Method 3: WordPress Debug Logging
With WP_DEBUG enabled, WhoKnew Views™ logs bot filter activity:
// In wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
// Then check /wp-content/debug.log for entries like:
🤖 WKV BOT FILTER CHECK
User-Agent: DataForSeoBot/2.0 (+https://dataforseo.com/)📋 Method 4: Online Bot Databases
Research known bots at these resources:
- user-agents.net — Comprehensive bot database
- crawler-user-agents (GitHub) — JSON list of crawler UAs
- whatismybrowser.com/detect/what-is-my-user-agent — Check your own UA
- robots.txt files — Bot documentation often lists their UA string
🏷️ How Custom Patterns Are Displayed
Once added, custom patterns appear in your 🚫 Active Bot Filters list with special styling:
🎯
MyCompetitorBot
CUSTOM Added: Jan 6, 2025 ✕ Remove
Custom patterns get a 🎯 icon and CUSTOM badge
The system also auto-categorizes your pattern if it contains known bot keywords:
| If Pattern Contains… | Auto-Category | Icon |
|---|---|---|
gpt, claude, gemini, anthropic, perplexity… | AI | 🤖 |
google, bing, yahoo, baidu, yandex… | SEARCH | 🔍 |
facebook, twitter, linkedin, discord… | SOCIAL | 📱 |
ahrefs, semrush, moz, majestic… | SEO | 📊 |
pingdom, uptime, gtmetrix… | MONITORING | 📡 |
bot, crawler, spider, scraper… | GENERIC | ⚠️ |
| (No matching keywords) | CUSTOM | 🎯 |
⚙️ Common Custom Pattern Scenarios
🕵️ Competitor Price Scrapers
Companies monitoring your pricing for competitive intelligence.
PriceSpider
Prisync
Competera
Intelligence Node
📊 Data Aggregators
B2B data companies harvesting product information.
ZoomInfoBot
Clearbit
DataForSeoBot
BuiltWith
🤖 New AI Crawlers
Emerging AI companies not yet in the catalog.
Meta-ExternalAgent
Bytespider
PetalBot
ClaudeBot
🔧 Internal Testing Tools
Your own QA or dev automation tools.
Selenium
Playwright
Cypress
your-company-qa-bot
🗑️ Removing Custom Patterns
Click the ✕ Remove button next to any pattern. You’ll see a confirmation dialog:
Remove “MyCompetitorBot” from bot filter?
This pattern will start being tracked again.CancelOK
ℹ️ Note: Removal is also instant—no cache clearing needed. The pattern stops blocking bots immediately, and any new visits from that bot will be tracked normally.
💡 Best Practices Summary
✅ Do
- Use specific bot names when possible
- Check server logs before adding patterns
- Test patterns on staging first if unsure
- Keep patterns short and targeted
- Monitor System Info for blocked activity
❌ Don’t
- Use common browser strings as patterns
- Add patterns without researching first
- Create overly generic single-word patterns
- Forget that matching is case-insensitive
- Assume patterns support regex (they don’t)