How do I block bad bots or user agents?

Blocking bad bots or user agents is as simple as adding the following code to your .htaccess file:

#Start
BrowserMatchNoCase "mj12bot" badbot
BrowserMatchNoCase "dotbot" badbot
BrowserMatchNoCase "gigabot" badbot

Order Allow,Deny
Allow from ALL
Deny from env=badbot
#End

You can replace or add "BrowserMatchNoCase "mj12bot" badbot" lines with the bot user agent you want to block.

Note: .htaccess is a system file, so it does not appear by default in cPanel's File Manager. You would need to update your settings to "Show all files" in File Manager to see it.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution