Block bad bots in .htaccess file in cPanel / WordPress / Apache
Add below code in .htaccess file
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*(adscanner|AhrefsBot|archive.org_bot|Baiduspider|BehloolBot|bingbot|BLEXBot|coccocbot-image|coccocbot-web|compatible|contxbot|DotBot|DuckDuckGo-Favicons-Bot|DuckDuckBot|Exabot|facebot|facebookexternalhit|Slurp|GrapeshotCrawler|houzzbot|MJ12bot|MojeekBot|Nimbostratus-Bot|PaperLiBot|PlurkBot|Seekport|SemrushBot|SEOkicks|SeznamBot|stagefright|SurdotlyBot|Sogou|TinEye-bot|YaK|YandexBot|YandexImages).*$ [NC]
RewriteRule .* - [F,L]
List of Bots which you have just blocked
adscanner
AhrefsBot
archive.org_bot
Baiduspider
BehloolBot
bingbot
BLEXBot
coccocbot-image
coccocbot-web
contxbot
DotBot
DuckDuckGo-Favicons-Bot
DuckDuckBot
Exabot
Slurp
GrapeshotCrawler
houzzbot
MJ12bot
MojeekBot
Nimbostratus-Bot
PaperLiBot
PlurkBot
Seekport
SemrushBot
SEOkicks
SeznamBot
stagefright
SurdotlyBot
Sogou
TinEye-bot
YandexBot
YandexImages
Exabot
istellabot
It gives sever error and had to delete.. please assist
It’s tested, so it shouldn’t give any error. Make sure you have rewrite module enabled in apache. If still not working, let me know. I know its been months.