Who’s Hitting Your WordPress Site While You Sleep? How to Find Out
- Time window (hours)
- 24 h
- You entered
- Requests threshold
- 100 requests
- You entered
Your WordPress site is likely being scanned, probed, or attacked by automated bots right now, even while you read this. To find out who is hitting your site, you need to check your server access logs or use a security plugin that logs IP addresses, user agents, and request patterns. This article explains how to identify those visitors, distinguish between harmless crawlers and malicious scanners, and take action to block the bad ones.
Formula
The calculator above gives you the average request rate for a given IP address over a time window. The formula is:
Rate = Number of requests / Time window (in hours)
Where:
- Rate = average requests per hour from one IP
- Number of requests = count of log entries from that IP in the window
- Time window = the total hours you are examining (e.g., 24 for a day)
An Example
Suppose you see 100 requests from a single IP address in your 24-hour window. Using the default values:
Rate = 100 / 24 = 4.17 requests per hour
That rate is low and likely a normal crawler. If you instead see 1,000 requests in one hour, the rate would be 1,000 / 1 = 1,000 requests per hour, which is almost certainly a bot attack.
Why Your Site Gets Hit While You Sleep
WordPress powers over 40% of all websites, making it a prime target for automated bots. These bots do not sleep; they run continuously from servers around the world, scanning for vulnerabilities. Common reasons for overnight hits include:
- Brute-force login attempts trying common usernames and passwords
- Scanning for known plugin or theme vulnerabilities
- Looking for files like wp-config.php or xmlrpc.php
- Spam comments or trackback spam
- Content scraping and hotlinking
Most of these are not personal attacks; they are automated scripts that target thousands of sites at once. Understanding this helps you respond calmly and methodically.
How to See Who Is Hitting Your Site
You have two main ways to see the traffic: server access logs and security plugins. Both have their place.
Method 1: Server Access Logs
Your hosting provider stores access logs for every request to your site. These logs typically include the IP address, timestamp, requested URL, user agent, and HTTP status code. To view them:
- Log into your hosting control panel (cPanel, Plesk, or a custom dashboard).
- Look for “Raw Access Logs”, “Logs”, or “Error Logs”.
- Download the most recent log file (usually named access.log or similar).
- Open it with a text editor or use a log analysis tool.
If you are on a managed WordPress host, you may need to contact support to request access logs. Many hosts provide them through a dashboard interface.
Method 2: Security Plugins
Plugins like Wordfence, Sucuri, or iThemes Security offer built-in traffic monitors that log IPs, user agents, and blocked requests. They often display the data in a friendly dashboard with graphs and tables. This is easier for non-technical users, but note that the plugin only logs traffic after you install it—it cannot show you historical data before that point.
How to Read the Logs: What to Look For
Once you have your logs, you need to separate the normal from the suspicious. Look for these patterns:
- Repeated requests to /wp-login.php from the same IP
- Requests to files like /wp-config.php, /xmlrpc.php, or /wp-admin/
- Many 404 errors for random paths (scanning for plugins)
- User agents like “python-requests”, “curl”, or “Go-http-client”
- Requests from countries where you have no visitors
If you see a single IP making dozens of requests per minute, that is a red flag. Normal visitors rarely make more than a few requests per minute.
What to Do About Suspicious IPs
Once you identify suspicious IPs, you can take action. The most straightforward approach is to block them via your hosting firewall or a security plugin. But be careful: some IPs are shared proxies or legitimate services (like Googlebot), so blocking them could hurt your traffic. Always verify the IP against a reverse DNS lookup or a threat intelligence service before blocking.
For WordPress specifically, you can:
- Enable two-factor authentication for admin accounts
- Limit login attempts (a plugin can do this)
- Disable XML-RPC if you don’t use it
- Keep all plugins, themes, and core updated
These steps reduce the chance that a bot succeeds even if it finds your site.
Common Mistakes and Misconceptions
One common mistake is assuming every repeated request is an attack. Search engine bots like Googlebot and Bingbot make many requests and are harmless. Check the user agent string and verify the IP against the official bot IP ranges before blocking.
Another misconception is that a security plugin alone will stop all attacks. No plugin can guarantee complete security; they only reduce risk. The best defense is a combination of updated software, strong passwords, and monitoring.
Also, don’t ignore the value of your logs. Many site owners only look at logs after an attack, but regular monitoring helps you spot trends early.
Frequently Asked Questions
Q: How do I find the IP address of a visitor in WordPress?
WordPress stores the visitor’s IP in the server logs, not in the database. You can also use a plugin that logs IPs, or add a simple PHP snippet to your theme’s functions.php to log IPs, but that is more technical.
Q: What is a normal amount of bot traffic?
It varies, but many sites see 50-70% of all traffic from bots. Most of that is search engine crawlers and monitoring services. The key is not the volume but the behavior—if a bot is hammering login pages, that is a problem.
Q: Can I block all bots with a firewall?
You can block known bad bots, but blocking all bots would also block Google, which would hurt your SEO. Use a firewall that distinguishes between good and bad bots, or manually allowlist known good crawlers.
Q: Should I use a CDN like Cloudflare to hide my IP?
Cloudflare can hide your origin IP and filter malicious traffic, but it is not a complete security solution. You still need to secure your WordPress installation. Also, a free CDN may not block advanced attacks.
Q: My site is slow at night—is that because of bots?
Possibly. If bots are hitting your site heavily, they can consume server resources and slow down response times. Check your server load during those hours and compare with your logs to see if there is a correlation.
Q: How do I permanently block an IP in WordPress?
You can add a rule to your .htaccess file (Apache) or use a security plugin that manages IP blocks. However, permanent blocks can be risky if the IP is dynamic or shared. Use temporary blocks and monitor the logs to see if the attacks persist.
Related
Formula used
in t | Time window (hours) | h | 24 | 1 in n | Requests threshold | requests | 100 | 10 out rate | Requests per hour | req/h | n / t | 1
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.