News & Updates -

Secure WordPress Forms: Best Practices to Keep Your Website Safe

By Published October 15, 2018

Secure wordpress forms

Secure WordPress forms are an important part of any lead generation strategy. If people are going to submit data and/or files to your site, you must take security seriously (for your sake and your users’).

Hackers and spammers use your forms to seek vulnerabilities in your website and force it to behave inappropriately.

They might use it as a mail server to send spam messages or infect other websites. They could also create hidden pages and blog comments with links to other sites, or simply break your website code entirely.

Hackers don’t just make your website and brand look unprofessional. They can also damage your Google search rankings, break your site’s functionality, and even get you caught up in legal trouble (depending on what the hacker does with your site).

While a WordPress form builder like Gravity Forms comes with some built-in security features, it’s still your job to secure your forms.

In this post, we’d like to go over some best practices to secure yours.

1. Set Your Forms to Double Opt-in

A simple way to secure WordPress forms is to enable double opt-in confirmation on your email list.

With a double-opt in, people who complete your forms receive an email with a link to confirm their subscription. They have to click that link in order to get their email address on to the list and receive whatever the form promised (like a lead magnet, product demonstration, etc.).

If the subscriber doesn’t click the verification link, they aren’t added to the email list and don’t receive your offering.

Most email marketing tools give you the option to set your forms to double opt-in. In fact, many prefer you use double opt-in because the extra step keeps people off email lists if they don’t really want to be there.

How do double opt-ins secure WordPress forms?

For one, they prevent people from putting someone else’s email address on your list.

If a person throws their friend’s email into your form with a single opt-in, their friend will get your messages and eventually mark you as spam. This affects your sending reputation and email deliverability.

If too many people mark you as spam, your email marketing service could kick you off. In worst cases, internet service providers could ban your domain.

Another reason to enable double opt-in on your email list is to avoid collecting non-existent email addresses.

In some cases, a person may throw a fake email address in your form just to get to the next page. Perhaps they want your free item without hearing from you again, or maybe they want you contact them some other way.

But if you put a dummy email address into your email marketing tool, they’ll charge you for it even though it can’t receive emails.

If you operate in the European Union (or abide by their standards because they’re higher), you have to comply with the GDPR. Double opt-ins are an important part of that.

2. Limit Your Field Inputs

One of the ways hackers gain access to your website is by injecting code into your form fields.

Your website code is written in a precise order. Form fields are opportunities for users to input their own data into that code to complete the sequence.

A password, for instance, is a chance for the user to enter the correct word that completes the code and unlocks the website.

But if a hacker wrote their own code and submitted through a form field, they could potentially add their own “language” to the sequence and force your website to behave in malicious ways.

So it’s important to prevent users from entering anything they like into your form fields. They should only be able to input the kinds of data that relate to that field’s purpose.

This is called input validation and it’s an important part of website security.

For instance, if you have a field that asks users to submit their zip code, you should limit that field to six characters and only numbers. There’s no reason to accept any other types of data because if it’s not six numbers, it’s not a zip code.

In Gravity Forms, you can apply rules to fields that limit the type of data users can input.

Secure wordpress forms

This is especially important to password fields on login forms. If you ask for passwords to have at least one uppercase character and a special character, set those requirements for the field. These limitations make it very difficult for hackers to write code to inject into your site.

If you let people enter anything they like into your form fields, you risk hackers probing your site for vulnerabilities and eventually gaining access.

3. Secure Your File Upload Features

A lot of forms these days allow users to submit their own files. These are common on job application forms and credit card / banking forms, but they’re useful for any site owner who needs unique information from their users.

But this feature is a prime opportunity for a hacker to upload something malicious that affects your website in unintended ways.

There are three ways to secure your file uploads:

1. Force users to log in before submitting.

If you don’t get a lot of accounts, you may want to approve them all manually. If you don’t want to bother with an approval process, use a reCAPTCHA to log in that automated bots can’t pass.

2. Limit the size of files that can be uploaded.

This isn’t a perfect solution because it’s possible for a hacker to write a small file of malicious code, but it makes their job a lot harder because they need something unique to your site. They’ll probably just try to hack someone else’s website.

3. Limit the types of files that can be uploaded.

The most effective way to secure your file upload field is to limit the type of files people can upload. If you ask for a resume, for instance, limit the field to .DOC and. PDF files. This way a hacker can’t submit unique files with malicious software.

Secure wordpress forms

4. Enable reCAPTCHA

How do you know whether the users who fill out your forms are real people behind actual computers… or automated bots programmed to break into websites?

Truthfully, you don’t. To your website, all traffic looks the same.

So you need a way to test whether the user is a human being. That means asking them a question computers can’t answer.

Secure wordpress forms

CAPTCHA is a security system designed to distinguish between computers and humans. It’s an extra field that requires users to correctly type a few letters and numbers they see displayed on an image.

Since computers can’t read images, they can’t answer the field correctly.

CAPTCHAs are really effective, but they come with a significant drawback: They’re hard for users.

In one test, only 62% of participants were able to successfully complete a CAPTCHA on their first try. 23% struggled multiple times before getting through. Extra form steps increase the likelihood of form abandonment, so you want them to be as simple as possible.

In response to CAPTCHA’s problems, Google launched reCAPTCHA, a similar feature with an important improvement: All users have to do is check a box.

Secure wordpress forms

reCAPTCHA works by hiding the checkbox inside a special type of code that most bots don’t see. Therefore they can’t manipulate it.

With CAPTCHA or reCAPTCHA enabled, hackers have to manually visit your site on a computer in order to break in, rather than send their code all over the web automatically. That adds a lot of work, which means breaking into your site may not be worth it for them.

5. Install an SSL Certificate

This is a general security tips that makes your site safer in a lot of ways, but helps secure WordPress forms too by protecting your users.

An SSL Certificate is a type of encryption that hides sensitive information as it passes between your site, your customers, and other parties.

The easiest place to get an SSL Certificate is your hosting provider. They usually offer a one-click package that adds the cost to your invoice. But you can also get one from places like DigiCert or Namecheap.

Once you have an SSL Certificate, the HTTP in your URL will change to HTTPS and you’ll gain the little green padlock icon.

Secure wordpress forms

According to GlobalSign, 77% of users are concerned about their data being intercepted or misused online. They look for security indicators (like the green lock icon) when they visit websites, but especially before giving out information or making purchases.

Secure wordpress forms

So if you want users to know you have secure WordPress forms and that their data is safe, install an SSL Certificate right away, even if you don’t process payments.

Going Forward

Security is no joke. Even if you have a small website, it’s important to build secure WordPress forms to protect you and your users. If you don’t take security seriously, malicious parties could damage your business and brand.