Some websites ban specific IP addresses to block users with intolerable behaviour. But these bans are not always a good idea. Why not? Because changing your IP address is very easy: just turn off your router and turn it on again, and your IP is changed (if you have a dynamic IP and not a static one). But even if you have a static IP, changing it into a dynamic IP is very easy. So banning an IP is not very effective, and, even worse, it can also block an innocent user if the banned IP is assigned unforeseen to that user.
But can IP bans be effective? Yes, they can, if you want to ban an anonymous open proxy, because their IP addresses don’t change that much. It can also be effective if you want to ban someone for a short time, for example if someone is continuously sending requests to your website. You don’t disturb other users with the same IP too much (at least if you tell the reason), and you prevent the attacker from sending more requests.
But I want to block a user permanently! How can I do that?
Well, in fact, you cannot really prevent someone from accessing your website. The best you can do is using a user account system, and block the email address of annoying users. It doesn’t really stop them because they can keep creating new email addresses, but it’s better than nothing. Also, when doing that, make sure that you confirm the email address before the account is created. Otherwise, someone can use a non-existing email address and it won’t change anything if that email address gets banned.