Skip to main content

Joomla Configuration

Blocking an IP address on your Joomla website

It is, of course, possible to deny a particular IP address access to your Joomla website.

Reasons could be:

  • Someone is trying to hack your website.
  • Someone is copying content from your website.
  • Someone links to images or other media on your website.
  • Someone attacks your website with many requests.
  • Someone continuously spamming your website.

You can address this in several ways.

Blocking an IP address with Akeeba Admin Tools PRO

You can block an IP address using an extension such as the PRO version of Akeeba Admin Tools.

Using the Web Application Firewall, you can also automate things. For example, you can have a particular IP address blocked after X number of failed login attempts. (Note that you could potentially also be blocked yourself if you don't add your IP address to the Whitelist).

Blocking an IP address in the .htaccess file

You can block an IP address by adding it to the .htaccess file.

- Connect to your website via FTP
- Download the file named .htaccess
- Add the following lines to the .htaccess file:

order allow,deny
deny from 12.34.567.890
allow from all

If you are being attacked by multiple IP addresses, you can add as follows

order allow,deny
deny from 12.34.567.890
deny from 12.34.567.891
allow from all

Now let's assume you are being attacked by a range of IPs, for example all IPs starting with 12.34.567, here is what you need to do:

order allow,deny
deny from 12.34.567
allow from all

Now the question remains: how do you know what the IPs are that are spamming you? You check your logs and see if there are repeated requests from the same IP address.

Need professional security?

Are you unsure about which IPs to block, or do you find editing server files too technical? I would be happy to take care of the security of your Joomla site for you.
Jeroen Moolenschot

About Jeroen

I have been working with the Joomla! CMS since 2006. Besides building and maintaining Joomla! websites and webshops, I am also familiar with search engine optimization (SEO), Joomla hosting and developing templates and extensions. Furthermore, I am a frequent visitor and speaker at JoomlaDays and various Joomla user groups.

I am committed to the Joomla! community as a member of the Extensions Directory team and the organization of Joomla user group Breda and JoomlaDagen Netherlands. In short: Are you looking for a Joomla Specialist, you should contact me!

Popular articles

Redirecting an old URL to a new URL in Joomla

Sometimes, some of your valuable links may lead to the 404 page. This usually happens when the alia…

Disable Joomla Update Notification email

Joomla has a plugin by default that emails every administrator with superuser privileges when a Joo…

Preventing spam in Joomla with Captcha

Nothing is more annoying than a mailbox full of spam responses or fake requests via your contact fo…

Hiding a menu item

In some cases, it is desirable to link to another article. This is not always possible without affe…

Joomla GDPR settings

25 May 2018, the GDPR came into force. Probably your mailbox has also been flooded with privacy pol…

Code is automatically deleted

After adding custom HTML code in an article or module, you might find that the HTML code has been r…