Site security is an important topic for everyone. Often, you will need to react to an abusive visitor to your sites. One common response is to block an IP address from accessing the site. This will prevent anyone from that IP address from using the site and disrupting its normal flow. Below is quick guide on how to block and unblock IP addresses from accessing your Drupal 8 site.

In this tutorial:

How to block/unblock IP addresses in Drupal 8

Enabling the Ban Module

Unlike Drupal 7, the ability to block IP addresses is not enabled by default. This ability has been moved from the System module into its own Ban module.

  1. Log into your Drupal 8 admin interface.
  2. From the top menu bar, click on the menu tab and then the Extend tab from the second menu bar.
  3. You are now on the modules list page. The Ban module is listed under the Core category. To enable it, simply click on the checkbox to the left of the module.
  4. Once selected, scroll to the bottom and click on the Save Configuration button to enable the module. Now that you have the Ban module enabled, you can now block IP addresses.

How to block an IP address

If your site is being abused by spammers or other online miscreants you may decide to block their IP address. You can do so by first logging into the Drupal 8 admin interface. From there, use the top menu bar and click Menu >> Configuration.

Once on the Configuration page, look under the People category and click on the IP Address Bans link. This brings you to a page named IP Address Bans. Enter the offending IP address in the IP Address field and then click on the Add button.

How to unblock an IP

If you discover that a blocked IP address is no longer valid or the person blocked has apologized and reformed their bad behavior, you can remove the IP address from the list. Simply visit the list using the same method as above.

Once you get to the IP Address Bans page, find the specific IP address on the list and click the Delete button on the left side of the row. Simply click Delete once more on the confirmation popup and you are done!

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Write New!
Do you want to publish a tutorial to our support center?

News / Announcements

SSL Certficate Warnings
Updated 2014-04-14 11:34 am EST
Hits: 2242
Heartbleed 0-day OpenSSL security bug
Updated 2014-04-14 04:43 pm EST
Hits: 5680

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!