Title: Best Method for Blocking Bad Bots
Last modified: October 16, 2021

---

# Best Method for Blocking Bad Bots

 *  Resolved [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/best-method-for-blocking-bad-bots/)
 * Good Day!
 * Essentially, there are five (5) methods for blocking and/or redirecting bad bots.
 * They are:
 * (1) Via .htaccess file
    (2) Via plugin (e.g., SG Optimizer, Wordfence, Blackhole
   for Bad Bots) (3) Via CDN (e.g., Cloudflare, KeyCDN) (4) Via robots.txt file (
   5) Via host server (built-in code)
 * In order to protect server resources and achieve the highest level of protection,
   which method do you recommend?
 * At a glance, the robots.txt file method seems the most logical way to go, but
   adding tens if not hundreds of bad bots to the robots.txt file doesn’t seem efficient.
 * Currently, we are blocking known bad bots via Cloudflare’s Firewall Rules (no
   other method being used), and it seems to be working pretty good.
 * Thoughts on this appreciated.
 * Thank you!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [4 years, 7 months ago](https://wordpress.org/support/topic/best-method-for-blocking-bad-bots/#post-15002175)
 * In .htaccess files you can block IPs and User-Agents. Both aren’t reliable.
 * Bad bots don’t honour robots files.
 * The best way is through a service running on your servers and we have such service.
   You can keep doing it on CF since you have them running fine. If such check reaches
   the plugin this means that it will use some resources to process this request
   and filter it or pass it through.

Viewing 1 replies (of 1 total)

The topic ‘Best Method for Blocking Bad Bots’ is closed to new replies.

 * ![](https://ps.w.org/sg-security/assets/icon-256x256.gif?rev=2971855)
 * [Security Optimizer - The All-In-One Protection Plugin](https://wordpress.org/plugins/sg-security/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-security/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-security/reviews/)

## Tags

 * [bots](https://wordpress.org/support/topic-tag/bots/)

 * 1 reply
 * 2 participants
 * Last reply from: [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/best-method-for-blocking-bad-bots/#post-15002175)
 * Status: resolved