Skip to main content




Blocking IP addresses is a good security measure for our blogs. In this course tutorial WordPress.com we teach you to block IP addresses on WordPress.

What is an IP?

If you are a blogger or webmaster and you are fully immersed in the world of WordPress and webs, it is very safe you already know that it is a IP adress.

In case you need to remember it, we will refresh your memory.

IP refers to: Internet Protocol or Internet protocol.

The IP is the number by which a computer or connection is identified. It is then you ID number In the net. And that of your visitors.

An example of IP would be:

"199.154.1.7"

Without the quotes.

And they are all structured in four number blocks:

111.222.3.4

These four blocks of numbers are separated from each other by dots. All IPs follow this hierarchy, without exception.

Why is IP important?

Having said the above about the Internet Protocol, bien puedes pensar que lo de las direcciones IPs de tus visitantes no te beneficia como blogger o webmaster. Pero te equivocas.

It is precisely by means of the IP adress that we can do against attacks of spam massiveandDDoS attacks.

A subsection:

Los ataques DDoS son aquellos quese basan en grandes volúmenes de datos dirigidos a una dirección determinada. Con el fin de colapsar la capacidad del server.

That footprint left by your visitors with the identification number will allow us to restrict their access.

Come on, you can always put the poster of: se reserves the right of admission. And keep unwanted visitors at bay.

Yes, we already know that you want to take action. Therefore, without further delay we will show you the different ways to:

Block IP addresses in WordPress

Block IP addresses in WordPress with .htaccess

For restrict access to certain IP addresses without using plugins we can create or modify the file.htaccess.

Para hacer esto recomendamos usar un editor de texto dedicado a tareas de programming. Nosotros usamos Notepad ++.

With the .htaccess file we have several possibilities.

  1. Bloquear un Username específico:

Block a specific user

This is done when we type in the full IP address of the user in question. In this case:199.154.1.7

 

  1. Block multiple users from a common address:

 

Block multiple users from a common address

In this case, all users who share the range 199.154.1they will be banned from your site.

Although there is still a way to mass ban more effective. And it is without a doubt one of our favorites. It is that sometimes it happens that many  attackers from spam they use Dynamic IP (IP addresses that they change constantly). Or one VPN connection that masks the registration number of that netizen. So it is difficult to specify them from a specific IP.

To carry out this blocking from .htaccess we need to locate the host name from malicious users.

order allow, deny

deny from hostingdespammers.com

allow from all

host name

With this trick you can already face certain attacks from Specific IPs. It is recommended for nostalgic lovers of manual tasks. And when it consists of spam attacks that do not exceed a dozen IP addresses.

Bloquear direcciones IP en WordPress desde cPanel

This method, very much in line with the first, will allow you to block addresses IP of determined users. It is a method cash when you have good specified the IP address of the attacker or the attackers. Although in this case it should be rather few. Because it is impossible to add hundreds of addresses IP manually.

To carry it out we log in to our cPanel.And follow the following route:

Security> IP Blocker

Once the IP blocker is located, we add the IP or IP addresses that we need ban from our site. When you have all the unwanted IPs in the list, click Add.

Be careful not to include your own IP address, that of one of your collaborators or that of visitors more faithful.

Block IP addresses from WordPress dashboard without plugins

Yes, it is possible to restrict access to the IP addresses you want (and that you have specified) from the WordPress dashboard  without plugins.

The procedure is simple.

We will obtain the IP from the comments left on our site.

If every time a user comments on our site, at the same time as a comment loaded with affection (or spam) they leave us their IP address.

And we can block it by following this route:

Settings> Comments

Once there we find the option:

Comments blacklist

In it we will add all the IPs of annoying users.

Un dato adicional: estos usuarios pueden navegar por nuestra Web pero ya no podrán dejar comentarios.

Block IP addresses in WordPress with plugins

We like plugins. And on repeated occasions we have recommended a few that can well help you in the task of blocking IP.

Plugins dedicated to security tasks such as:

  • Jetpack
  • WordFence
  • Akismet

We use and recommend WordFence to cope with attacks. Although in the WordPress plugin repository there are other tools (free and paid) that at the same time fulfill this function.

Did you like the tutorial and tips for blocking IP addresses? Do you want to keep learning? Well, what are you waiting for to sign up for the best online course in Spanish in WordPress and become an expert.