Combat Contact Form Spam

combating inbound spammer from forms
Home » Blog » Combat Contact Form Spam
Free Web Marketing Consultations

Helping B2B Technology Companies Increase Their Lead Volume.
Serving: IT, MSP, Cybersecurity, Software Dev, SaaS, ISV, VARs & More.

Table of Contents
    Add a header to begin generating the table of contents

    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.

    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.

    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.

    YouTube video

    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.

    Share This Article
    Posted in:
    Tagged:

    Hunter Nelson

    Hunter is the founder and president of Tortoise and Hare Software, a digital marketing agency for the technology sector and other lead generation oriented businesses. Hunter has more than 10 years’ experience building web applications and crafting digital strategies for companies ranging from scrappy startups to Fortune 50 household names. When not on the clock, you'll find him spending time with his family and pups, relaxing on the beach, or playing competitive online video games. See for more.

    4 responses to “Combat Contact Form Spam”

    1. Daniel Avatar
      Daniel

      Thanks for providing the JavaScript to disable pasting of text on our contact form! It reduced some of the spam that I received from my WordPress sites. However, some really determined spammers were able to overcome it by either disabling JavaScript on the browser or by typing out the entire spam message by hand.

      Instead of fighting this on the client side, I found a way of filtering out spam on the server side, using Artificial Intelligence (AI). By following simple instructions from this page: https://blog.ivertech.com/blog/how-to-install-ivertech-spam-free-contact-code-on-wordpresscom I was able to embed one line of HTML code on my WordPress site and let Artificial Intelligence figure out if a message is spam or not.

      I was able to weed out close to 95% of the spam from my contact forms since I embedded the code. It was really easy to implement, and best of all it’s free! Just thought your audiences might find this useful.

    2. barry - web designer Avatar

      onCopy=’return false’ onDrag=’return false’ onDrop=’return false’ onPaste=’return false’

      add this to your form fields.

    3. DCC Scotland Avatar

      blocking spam on contact form now days very easy. in word press so many plugin to use.
      Use WordPress Antispam Plugins
      Use the Honeypot Antispam Method
      Use a Custom CAPTCHA
      Use reCAPTCHA
      Block Traffic by IP Address

    4. Letting Agents Dundee Avatar

      I liked your website very much, it was nice and the article you published helped me a lot, thank you

    Leave a Comment





    Recent Blog Posts

    Aesopians E8 – How SaaS Companies Are Maintaining Brand Integrity and Operationalizing Growth with HubSpot Ft. Mohamed Hamad Of Third Wunder Agency

    SaaS companies move fast—but if your branding and systems can’t keep up, growth can actually become a liability. In this episode of the Aesopians Podcast, host Hunter Nelson is joined…

    The Ultimate Guide To ChatGPT SEO

    Most SEO professionals are racing to understand how AI tools are reshaping visibility. But the biggest shift isn’t coming from Google—it’s coming from ChatGPT. As organic search volumes and conversions…

    MSP Google Ads Costs and Pricing

    You’ve heard Google Ads can generate leads quickly, but you’re not sure how much to budget, what kind of results to expect, or whether it’s really worth the spend. Many…

    Aesopians E7 – Joining The Feel Good MSP Sales Training Program Ft. Brian Gillette

    In this episode of the Aesopians Podcast, we sit down with Brian Gillette, founder of Feel-Good MSP and creator of the “Feel-Good Close.” If you’re an MSP leader who’s tired…

    MSP Advertising Strategy: 3 Fundamental Approaches to Drive Real Growth

    Is your MSP making effective use of your advertising budget, or are you weighed down too much by bottom of funnel advertising tactics that leave you in a perpetual cycle…

    How We Save Thousands With Negative Keywords For MSP Google Ad Campaigns

    Google Ads is one of the most powerful inbound lead generation channels available to managed service providers. There are few better moments to introduce your brand than when someone is…

    Aesopians E5: From Tech To Rep: Year 1 In MSP Sales Ft. Ashton Fortuna

    Most MSPs hesitate to move technicians into sales—worried they’ll lack the polish, confidence, or killer instinct to close deals. Sales is a different game. Techs solve problems with systems; sales…

    SEO Not Working: Here’s Why

    Lately I’ve been getting on more and more calls lately with people saying something along the lines of “we’ve been doing SEO or inbound for 6 months, 12 months, or…

    Why SEO Investments Help Your MSP Weather a Recession and Keep the Door Open for New Opportunities

    What happens to your pipeline when the phones go quiet, inboxes stay cold, and paid ads stop converting? That’s not a hypothetical. It’s what happens in a recession. Budgets freeze.…

    MSP Marketing – How to Build a Strategy That Works

    Let’s be honest—most MSP marketing doesn’t work.Not because the tactics are bad, but because they’re unaligned. What looks like a marketing problem is often a strategy problem in disguise. Most…

    The 10 Best MSP SEO Agencies To Help You Grow Organic Traffic

    If you’re searching for SEO agencies for MSPs, the list of generalists can feel endless—and underwhelming. Most SEO providers don’t understand the managed services space, much less the buyer behavior,…

    Why Your MSP’s Online Marketing Efforts Are Failing

    If you’re leading an MSP and investing in online marketing, you’re probably feeling a growing sense of frustration. You’ve put money into websites, content, ads—even hired an agency or two…

    What Makes a Great MSP Website? 5 Examples You Should Follow

    Your MSP website is more than just an online brochure—it’s a powerful tool for attracting and converting potential clients. But what makes a website truly effective in the competitive managed…

    Case Study: Cold Start To 2-5 Leads Per Month Via Local SEO For MSP In Canada

    Client Background A Managed IT Services Provider (MSP) in British Columbia, Canada engaged us to establish a professional online presence and generate a steady flow of inbound leads. Before working…

    Aesopians Episode 4: Leading with Cybersecurity To Spark MSP Sales Conversations – Featuring Michael Bakaic Of Iceberg Cyber

    In this episode of the Aesopians Podcast, Hunter Nelson sits down with Michael Bakaic from Iceberg Cyber to discuss how MSPs can use cybersecurity as a conversation starter to attract…

    WordPress Out OF Memory Exceptions

    Recently I’ve been dabbling in programmatic SEO. I got an idea of rolling out a landing page to attract search engine traffic from every major city in the United States…

    Aesopians Episode 3 – Cold Email Marketing For MSPs Featuring Jeffrey Newton Of Cyft.AI

    In this episode of The Aesopians Podcast, Hunter Nelson sits down with Jeffrey Newton, Co-founder of Cyft and former MSP sales and marketing leader, to discuss the realities of running…

    Case Study: Sourcing 30+ Email Opt-Ins Per Month For Cybersecurity SaaS Startup Via Google Ads

    In this case study we’ll share how we helped a Cybersecurity SaaS startup source roughly 30 email opt-ins per month via Google Ads to help fuel their email marketing efforts…

    Aesopian’s Episode 2 – Streamlining SEO Content Production Featuring Raj Khera Of Make Media

    In this episode of the “Aesopians” podcast, we’re joined by Raj Khera, a serial entrepreneur and the founder of Make Media, to discuss how small businesses can transform their approach…

    Aesopians Episode 1 – Azure Cloud For MSPs

    In the debut episode of Aesopian’s Podcast, host Hunter Nelson sits down with Matt Hache, an infrastructure consultant at PAX8 and founder of Neon Cobra, to explore how Managed Service…

    Related Blog Posts

    WordPress Out OF Memory Exceptions

    Recently I’ve been dabbling in programmatic SEO. I got an idea of rolling out a landing page to attract search engine traffic from every major city in the United States…

    How To Generate More MSP Website Leads With A Primary Call To Action

    In today’s digital age, your Managed Service Provider (MSP) website serves as the cornerstone of your online presence. It’s the virtual gateway for potential clients to explore your services, expertise,…

    Your WP Server Cache Might Be Costing You Leads

    Over the past 3 months I’ve been battling an infuriating and troubling issue. Some of my WordPress site’s forms were not submitting! But not all the time, just some of…

    Why We Recommend Page Builder Websites For Startups

    If there’s one word that characterizes startup companies it’s instability. I see this across service providers like IT companies and product companies like SaaS startups. Small and growing companies oftentimes…

    Why A B2B Website Should Cost $10,000+

    In today’s post, I want to break down a common misalignment between B2B website purchasers and agencies when it comes to website development. Website pricing, like all goods and services,…

    The 5 Second Test For PPC Landing Pages

    I’ve been having a lot of conversations recently about optimizing websites for lead generation and explaining a concept called the 5 second test. The 5 second test is a design…

    Why You Should Keep Your SaaS Installed On A Subdomain

    More than a few SaaS founders start out with a technical background, looking to parlay their coding skills into a product and build a business off it. Their surplus of…

    Essential Design Considerations For A WordPress Website

    Building a high-performing WordPress site for your business is a bit more involved than many understand. On one hand, it’s relatively easy to get started with, but on the other,…

    3 Essential Deployment Environments For Your WordPress Marketing Website

    When starting with a new client on their website, one issue I frequently encounter is the lack of deployment environments. Often times there is only one consumer facing website instance…

    WordPress Architecture For Beginners

    I recently gave a talk at the WP Jax Meetup group on the WordPress Architecture for Beginners. This is a group I’ve been going to for about 9 months and…

    Site Speed as a Competitive Advantage

    Site speed is becoming a critical factor in the success of a marketing website. It has become the most important ranking factor for SEO, is strongly correlated to bounce rate,…

    Top Blog Content

    The Ultimate Guide to Hiring an MSP Marketing Agency

    Are you one of the many MSPs struggling to attract new clients consistently? According to research conducted by MSP Dojo, a leading MSP sales consulting firm, approximately 85% of MSPs…

    The Ultimate Guide To MSP Website Optimization

    A well-optimized website is essential for Managed Service Providers (MSPs) looking to scale their business, attract more leads, and achieve a lucrative exit. A lot of MSPs check a few…

    The Ultimate Guide To Paid Search On Google Ads For Managed Service Providers

    Generating leads for your MSP can be a challenge. You spend so much time managing employees, making sure customer support tickets are answered, procuring hardware, and defending against cyber threats,…

    The Ultimate Guide To MSP SEO

    Search Engine Optimization (SEO) is one of the most important ways to attract new business for mid-market managed service providers (MSP). If you look at MSPs that have achieved any…

    The Ultimate Guide To Setting A Marketing Budget For IT Companies

    Many IT companies 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…

    Featured Review of Tortoise and Hare

    ryan drake president nettech consultants
    R.D.
    President Florida Based MSP

    Tortoise and Hare has been a key partner in our MSP's growth. Over the year's we've worked together they've helped our MSP dramatically increase our website traffic, and build a steady stream of leads sourced from our website and advertising efforts. Over that time, we've been able to raise our base customer size, build economies of scale to more efficiently service customers, and expand into new markets.