How to block Bad Bots (User Agents) using .htaccess

Some bots can cause a high load on servers as they index too many pages or get into some never-ending loop.

last day one of the servers I manage had a very high load. On checking apache logs, i have thousands of access like

In this case, the bot user agent is

To block the bot, I added the following code in .htaccess file

This will block any visitor with Browser User Agents SeekportBot or SpamBot2.

To block common marking bots, run

If you are using Nginx web server, see How to block bad bots User-Agents in Nginx or using Block User-Agent using Cloudflare

Back to htaccess

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *