Blocking spam on the contact form

One of your first tasks on a new Drupal site is blocking spam and bots from the contact form.

Drupal comes with a contact form, usually found at https://yoursitename.com/contact. It's a handy way for visitors to reach you.

However, it's also a handy way for spammers and bots to reach you.

Fortunately, it's easy to use a spam blocking module to stop most contact form spam.

Honeypot is one of my favorite anti-spam modules, and it's easy to install:

  • install it like usual, either using the Add new module button on the Extend page, or using the composer command on the Honeypot module page
  • go to the Extend page and enable the module
  • go to the Honeypot configuration page at https://yoursite.com/admin/config/content/honeypot to configure the module

The defaults work really well, but I recommend also selecting