How do I block bots?

I am still creating my site and learning about the free plan, and of course later I will move to the paid plan, but now I have a problem and my site is temporarily suspended for 24 hours, and this happens a lot. It happens every day. I searched and found that the problem is in the many bots that visit My site and this is depleting the cpu, my question is how to prevent any bot visiting my site. I watched videos on YouTube. They say download wordfence, but this add-on is depleting the CPU very much. Is there a way to block bots? I do not want any visits on my site

I don’t know if it is the best approach, but, you can write rules in your .htaccess which will block ip addresses. See this page, for example.

The first question I would ask is, how do you know you are being visited by bots?

What data are you looking at, which leads you to this conclusion?

2 Likes

But I do not know the ip address of the bots, I just saw a lot of visits to my site through cloudflare, although I did not publish my site on anything and no one knows my site

This guide should help you out.

4 Likes

That is correct. You will need to have access to access logs. Greenreader9 links a good resource, especially because you are also using CF. Also, consider that some people, and organizations, have made it their mission in life, or perhaps, just a hobby, to carefully document the latest ip ranges from threats. Take a look at this guy He’s been at it for 17 years.

With access to data which shows you request IPs, then you can use that information to search and see if other people, or organizations, have encountered and documented the bots.

Then, you will be able to write efficient blocklists, or, as seems to be the case with CF, firewall rules.

2 Likes

what to write here ?

call it whateverYouWant.cloudflare

in the future be careful when you post screenshots on this forum
so as not to accidentally reveal some important information

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.