WordPress Security ServicesMalware Removal
Hardening

WordPress Form Security: How to Stop Spam, Abuse and Form Exploits

Forms are one of the few places where strangers can send data straight into your website. Most of the time they just send spam. But a vulnerable form plugin, or a form that accepts file uploads, can be a way in. Here's how to keep WordPress forms secure without making them annoying to use.

Sergey By Sergey, WordPress security specialist Updated 2 min read
In this guide
  1. 1. Keep form plugins updated
  2. 2. Stop spam with layers, not one big wall
  3. 3. Don’t let your form send email to anyone
  4. 4. Be very careful with file uploads
  5. 5. Protect the data you collect

1. Keep form plugins updated

Form plugins are popular and complex, which makes them frequent targets. Keep them updated, remove form plugins you no longer use, and check them against vulnerability alerts. My security plugin comparison covers alert services.

2. Stop spam with layers, not one big wall

  • Honeypot fields, hidden fields that only bots fill in. Most form plugins offer them.
  • A bot check, such as Cloudflare Turnstile or reCAPTCHA, ideally the invisible or privacy-friendly kind.
  • Rate limiting: a few submissions per minute per visitor is plenty.
  • Content filtering: Akismet or similar services catch typical spam.

3. Don’t let your form send email to anyone

  • Turn off “send a copy to the sender” for anonymous visitors.
  • Never let a visitor choose the recipient address.
  • Send WordPress email through a proper SMTP or email service, with SPF, DKIM and DMARC set up.

Otherwise spammers can use your form to send spam in your name. See WordPress sending spam emails.

4. Be very careful with file uploads

A form that accepts files is the riskiest kind:

  • allow only the file types you need (for example PDF and JPG), never PHP, HTML or SVG from strangers;
  • limit file size;
  • store uploads outside the public folder, or in a folder where PHP can’t run;
  • scan uploaded files if your form plugin supports it.

More in secure WordPress file uploads.

5. Protect the data you collect

  • Store only what you need, and delete old entries regularly.
  • Make sure form entries aren’t publicly accessible (no directory listing, no public export files).
  • Use HTTPS everywhere, so form data is encrypted in transit.

From my cleanup work: form problems I see most often are not hacks but abuse: a form sending thousands of “copy to sender” emails until the host suspends email for the whole account. The second most common is a forgotten form plugin with an upload feature and a known vulnerability. Both are easy to prevent.

Sergey, WordPress Security Specialist
About the author
Sergey, WordPress Security Specialist

10 years in WordPress security and incident investigation, and more than 200 websites cleaned of malware. Top Rated on Upwork with a 100% Job Success score. More about me

Frequently Asked Questions

Can a contact form get my WordPress site hacked?

A simple, up-to-date form rarely can. The risks are vulnerable form plugins (keep them updated), forms that accept file uploads, and forms that can be abused to send email to anyone.

What's the best way to stop form spam?

Combine a few light measures: a honeypot field, a privacy-friendly CAPTCHA or bot check, rate limiting, and filtering. Avoid relying on one method only.

Is the "send a copy to me" option dangerous?

It can be abused. Spammers fill in someone else's address so your server sends them spam, which damages your email reputation. Turn it off, or only allow copies to logged-in users.

Need a hand?

Let me clean your WordPress site for you

Send me your site URL and what you're seeing. I'll reply with what I think is going on and the next step.

$95 per infected site · 1-month guarantee · direct contact with the specialist

Get My Site Cleaned →