Combat Contact Form Spam

combating inbound spammer from forms
Home » Blog » Combat Contact Form Spam

There’s nothing more frustrating than opening up your email in the morning and seeing a new contact form submission has come in off your website and realizing its just another spammer sending you a pitch. Spam, especially in the United States, has become a serious problem. You’re literally being targeted by the entire world! It can be especially bad if your using a highly targeted CMS like WordPress to power your site. This article will go through some tactics to stop contact form spam, regain a little bit of your sanity, and restore hope when checking your new contact form submissions.

Spammers Are Lazy

One great thing I’ve learned is that many spammers are lazy. Many of them are super cheap resources in foreign countries playing the numbers game. The slightest bit of difficulty encountered usually results in giving up and moving on the to the next victim.

When combating spam and trying to stop contact form spam presenting minor difficulties can be an effective method of defending your website.

Blocking Copy Paste

One effective method I’ve seen to stop contact form spam or stop form spam in general is to disable pasting on html textarea fields. Textarea fields are most often going to be your long form description fields where someone actually types the message they want to send to you.

stop contact form spam disable paste on textarea
Textarea field on a Tortoise and Hare Software’s Contact form

Disabling paste on a field is bad for usability and accessibility so it’s something to be used very sparingly. Textarea fields are going to be where a spammer is most likely to copy their pre-written pitch and paste it into the text area. If they can’t do that they are very unlikely to be determined enough to manually write their entire message into the field and most likely will just close the browser window and move on to the next target on the list.

How To Block Pasting To Stop Contact Form Spam

There are two ways a spammer can paste something into a field, the keyboard and the context menu. The keyboard paste is most often accomplished using the well known ctrl-v command and the context menu paste is accomplished by pressing right click on the mouse within the field and then selecting paste from the context menu. We need to prevent both if we want to stop spammers from blowing up our inbound forms.

context menu paste command stop spam
Context menu with paste command

This activity requires a developer to add some JavaScript to your page. Below is the base JavaScript you’ll need to add to block contact form spam.

This code requires a teensy bit of customization so can’t be blindly copy pasted. There are two things you’ll need to update

  • YourEventTypicallyDocumentReady
  • YourFormFieldSelector

YourEventTypicallyDocumentReady

In general you’ll want to run this code on document ready but certain plugins, ninja forms for instance, take advantage of that event handler already so you may need to hook into a custom after form ready event or later event. A developer should be able to help you figure this out.

YourFormFieldSelector

Next you’ll need to choose the form field selector you want to disable the appropriate form fields. This could range from a specific form with an element selected by #ID or a class that you use to tag all the form fields you want to disable paste on to stop contact form spam. .stop-spam for instance.

stop contact form spam with a JavaScript developer

If you’re feeling a little overwhelmed by any of the JavaScript, I’ve included a video walk-through with some additional commentary on working with the snippets below.

Stopping Contact Form Spam

Unfortunately spam is an ongoing problem and in all reality it’s nearly impossible to block all spam. There are ways spammers could bypass this method but most of them are too lazy or don’t have the development capabilities to bypass. You can block a pretty significant portion of contact form spam with a small update to your JavaScript code. We hope you enjoyed the article and can benefit from this snippet! Got any other tips for stopping spam? Drop us a line, we’d love to hear from you.

Tagged:

About The Author

Hunter Nelson President of Tortoise and Hare Software

Hunter has more than 10 years’ experience in the software industry building and configuring software for companies such as American Express, Black Knight, Homes & Land, Verizon and more. Hunter earned his bachelor’s degree in Information Technology from Florida State University in 2009 and began his career consulting for Accenture out of the New York City office. After accruing significant experience working with Fortune 500 Clients on complex software projects as an analyst, he discovered his love for coding and building software. While practicing the craft he earned an MBA from Florida State in 2017. In 2018 he founded Tortoise and Hare Software to begin providing business value in digital consulting engagements to small and medium sized businesses and helping them along in their journey toward the Fortune 500. See LinkedIn fore more.

Up Next

5+ Essential Google Ads Campaigns For Your Ad Account

By Hunter Nelson | June 21, 2020

Advertising your business on Google Ads is fantastic way to drive traffic to your website and generate leads for your company. Many companies don’t know where to start when it comes to creating campaigns, or structuring their account in general, so today I wanted to go over a few of the essential Google Ads campaigns…

Why Is Blogging Important For Business?

By Hunter Nelson | March 18, 2020

If you’ve owned or run a business for any length of time, chances are you’ve checked out a few competitor websites and noticed everyone has the obligatory blog link at the top of their website’s navigation. Maybe you’ve clicked through a few posts, most of which weren’t particularly interesting or helpful, and chances are a…

Passive Lead Gen For Janitorial Supply Company

By Hunter Nelson | December 30, 2019

Southern Cleaning Supply is a janitorial supply company based out of Panama City FL. They provide cleaning supplies and equipment to local businesses, nonprofits, and government organizations in Panama City and surrounding areas. Southern Cleaning Supply has been in business for over 30 years but experienced an ownership change in 2018. Shortly thereafter, new management…

Bid on Branded Keywords

By Hunter Nelson | December 19, 2019

Why are we spending money on branded keyword searches if we’re already ranking at the top of the page? This is a good question that clients often ask when getting started with PPC and one that has a number of compelling reasons to do so. In this post we will cover why you should bid…

This Is Why Your Marketing Sucks

By Hunter Nelson | November 16, 2019

Marketing sucks when you take a piggish outlook to investing in it, which ultimately leads to poor ROI and frustration. If you’ve ever done any reading on investing in the stock market, I’m sure you’ve heard the phrase “bulls make money, bears make money, and pigs get slaughtered”. Lately, I’ve been talking to a lot…

Marketing Consultant For Small Business

By Hunter Nelson | October 1, 2019

It can be a tough reality to face for some small business owners, but eventually every business is going to hit a growth ceiling where networking and referrals will no longer be enough to move the needle. Hiring a full time chief marketing officer or other senior in-house resource to launch a marketing department is…

High Bounce Rate? Digital Marketing is a Game of Inches

By Hunter Nelson | September 19, 2019

One of the first metrics people are going to look at when they start toeing the waters of web analytics is their bounce rate. If you’re just getting started on your journey to building an inbound pipeline chances are you’re suffering from high bounce rate and your trying to bring it down. In this article…

The Ultimate Guide To Setting A Marketing Budget For Small Business

By Hunter Nelson | August 19, 2019

Many businesses get their start as a one-man operation and rely almost exclusively on word of mouth, referrals, and other organic offline means to get past their initial growth stages and establish a revenue stream. Once the initial founders outgrow their capacity and begin to hire employees, the need to develop a more formal sales…

Why do I need a Privacy Policy?

By Hunter Nelson | July 16, 2019

Data privacy is a topic that is of growing concern to many consumers around the U.S. and you may have heard the term privacy policy a time or two in recent history but haven’t paid it much mind. If your just getting into digital marketing or are updating an existing marketing site you may be…

What is Inbound Marketing?

By Hunter Nelson | June 12, 2019

Inbound marketing is the process of designing a marketing strategy that results in customers coming to you to do business. This is in stark contrast to outbound techniques which rely on you or a sales team reaching out to prospects to educate them about your services. Most business owners are familiar with outbound tactics such…