■ Dealing with Bots on Your Website
1■■ What Are “Bots”?
• Good bots: Search-engine crawlers (Googlebot, Bingbot), uptime checkers, and social-media
preview fetchers.
• Bad bots: Tools that scrape content, guess passwords, or scan for vulnerabilities.
• Gray bots: Marketing or SEO crawlers that aren’t malicious but waste bandwidth.
2■■ Why They Matter
Bots can inflate analytics, consume bandwidth, trigger errors, or even find security flaws. Some
bots spoof user-agents (pretend to be browsers or Googlebot) to bypass filters.
3■■ First-Line Defenses
• Hide unnecessary files – Keep backups, admin panels, and test folders outside the public
webroot.
• Serve a robots.txt – List only what legitimate crawlers may access.
• Use HTTPS and updated software – Outdated CMS/plugins are bot magnets.
• Rate-limit traffic – Many hosts and CDNs let you cap requests per IP per minute.
• Block known offenders – Use your host’s IP deny list or .htaccess rules to block repeat scanners.
4■■ Stronger Protection (If Host Supports It)
• Firewall / WAF: Services such as Cloudflare, Sucuri, or ModSecurity automatically block common
attacks.
• CAPTCHA / JavaScript challenge: Forces human interaction on forms and logins.
• Geo-blocking: If you don’t serve certain regions, block those IP ranges.
• Hide admin URLs: Rename or move /admin, /wp-login.php, /moodle/login/, etc.
5■■ Watching for Trouble
• Check your access logs: Look for sudden spikes, repetitive hits to missing files (404s), or strange
query strings.
• Watch POST requests: Most malicious uploads use POST.
• Review new or modified files: Unexpected .php or .phtml files may indicate a webshell.
6■■ What to Do if You Suspect an Attack
1. Take a backup (files + database) before touching anything.
2. Scan with a malware tool (e.g., ClamAV, ImunifyAV, Maldet).
3. Block the IPs making suspicious requests.
4. Update all passwords (hosting, CMS, email).
5. Ask your hosting provider to check for compromised files or run a deeper scan.
7■■ Keep Perspective
Even large sites see constant automated traffic. The goal isn’t zero bots—just reduce their impact
and detect abuse early.