wordpress表单调用_如何在WordPress中阻止联系表单垃圾邮件(5种行之有效的方法)

wordpress表单调用

Are you getting a lot of spam messages through your website contact form? This can be really frustrating and time consuming to deal with.

您是否通过网站联系表收到大量垃圾邮件? 处理起来确实令人沮丧和耗时。

The good news is that there are automated ways to stop contact form spam in WordPress.

好消息是,WordPress中有自动停止联系表单垃圾邮件的方法。

In this article, we will share 5 different ways to reduce and block contact form spam in WordPress.

在本文中,我们将分享5种减少和阻止WordPress中的联系表单垃圾邮件的方法。

How to block contact form spam in WordPress
为什么您需要阻止联系表格垃圾邮件 (Why You Need to Block Contact Form Spam)

Contact form spam is usually automated. It’s an issue even for small, little-known websites as it’s carried out by “bots” that automatically send spam.

联系人表格垃圾邮件通常是自动进行的。 即使是小型的鲜为人知的网站,这也是一个问题,因为它是由自动发送垃圾邮件的“机器人”进行的。

These spambots crawl websites and look for non-secure forms, so they can email you spammy links.

这些垃圾邮件搜索者会爬网网站并查找不安全的表单,因此它们可以通过电子邮件向您发送垃圾链接。

They may also try to break into your login form by using brute force attacks, which is one reason why WordPress security is so important.

他们还可能尝试使用蛮力攻击闯入您的登录表单,这就是WordPress安全如此重要的原因之一。

Sometimes, they can even look for vulnerabilities in your site’s forms, so they can hijack them to send malware or spam to other people.

有时,他们甚至可以在您网站的表单中查找漏洞,因此他们可以劫持它们以将恶意软件或垃圾邮件发送给其他人。

This means that spam isn’t just a nuisance. Those spambots can be dangerous to your website, and your reputation.

这意味着垃圾邮件不仅是令人讨厌的事情。 这些垃圾邮件会对您的网站和声誉造成危险。

Let’s take a look at some proven methods for preventing contact form spam on your WordPress site.

让我们来看看在WordPress网站上防止联系表格垃圾邮件的一些行之有效的方法。

1.选择正确的WordPress表单插件来打击垃圾邮件 (1. Choosing the Right WordPress Form Plugin to Combat Spam)

Many WordPress contact form plugins don’t come with built-in spam protection. Those that do have some spam protection features often aren’t very reliable or easy to use.

许多WordPress联系人表单插件没有内置的垃圾邮件保护功能。 那些确实具有某些垃圾邮件防护功能的服务通常不是很可靠或难以使用。

The most effective way to block contact form spam is by choosing the best WordPress contact form plugin.

阻止联系表格垃圾邮件的最有效方法是选择最佳的WordPress联系表格插件

We recommend using WPForms, because it comes with built-in “honeypot” spam protection, which we’ll cover in a moment.

我们建议使用WPForms ,因为它带有内置的“蜜罐”垃圾邮件保护功能,我们将在稍后介绍。

It also has built-in reCAPTCHA and custom CAPTCHA functionality that lets you fight spam. We’ll be going through the different options you can use.

它还具有内置的reCAPTCHA和自定义的CAPTCHA功能,可让您与垃圾邮件作斗争。 我们将介绍您可以使用的不同选项。

First, you need to install and activate the WPForms plugin. If you’re not sure how to do that, then take a look at our step by step guide on how to install a WordPress plugin.

首先,您需要安装并激活WPForms插件。 如果您不确定如何执行此操作,请查看有关如何安装WordPress插件的分步指南。

Note: 3 out of the other 4 tips in this article also works on the free WPForms lite version as well.

注意:本文其他4个技巧中的3个也可以在免费的WPForms lite版本上使用。

Once WPForms plugin is activated, you’ll need to create a contact form.

WPForms插件激活后,您需要创建一个联系表。

Simply head to WPForms » Add New, enter a name for your form, and select the ‘Simple Contact Form’ template.

只需转到WPForms»添加新内容 ,为您的表单输入一个名称,然后选择“简单联系表单”模板。

Use the Simple Contact Form template

WPForms will automatically create a basic contact form for you with fields for the person’s name, email address, and message:

WPForms会自动为您创建一个基本的联系表单,其中包含该人的姓名,电子邮件地址和消息字段:

The default Simple Contact Form

By default, WPForms will enable an anti-spam “honeypot” for you. This is an invisible field that users can’t see, but that bots will try to fill out. When that field is filled out, the form will be rejected as spam.

默认情况下,WPForms将为您启用反垃圾邮件“蜜罐”。 这是用户看不到的不可见字段,但机器人会尝试填写。 填写该字段后,该表格将被视为垃圾邮件。

You can check this setting on any of your forms under Settings » General. ‘Enable anti-spam honeypot’ should be automatically enabled.

您可以在“设置”»“常规”下的任何表单上检查此设置。 应该自动启用“启用反垃圾邮件蜜罐”。

The Enable Anti-Spam Honeypot option is checked

What if some spam is still getting through? Then you can use any of the below methods to stop spammers from using your contact form.

如果仍有垃圾邮件通过该怎么办? 然后,您可以使用以下任何一种方法来阻止垃圾邮件发送者使用您的联系表。

2.使用ReCAPTCHA复选框阻止联系表格垃圾邮件 (2. Use ReCAPTCHA Checkbox to Block Contact Form Spam)

One straightforward way to stop the spambots getting through is to use ReCAPTCHA. This method also works with the lite version of WPForms.

阻止垃圾邮件通过的一种直接方法是使用ReCAPTCHA。 此方法还适用于WPForms的精简版。

ReCAPTCHA is a free tool available from Google, and we use it in combination with WPForms built-in honeypot system.

ReCAPTCHA是Google提供的免费工具,我们将其与WPForms内置的蜜罐系统结合使用。

To add a reCAPTCHA checkbox to your form, you’ll need to first go to WPForms » Settings in your WordPress dashboard and click on the ‘reCAPTCHA’ tab.

要将reCAPTCHA复选框添加到表单,您首先需要转到WordPress仪表板中的WPForms»设置 ,然后单击“ reCAPTCHA”选项卡。

The reCAPTCHA settings page in WPForms

Next, you need to select ‘Checkbox reCAPTCHA v2’ by clicking on it.

接下来,您需要通过单击选择“ Checkbox reCAPTCHA v2”。

To get your Site Key and Secret Key, you need to go to Google’s reCAPTCHA setup page.

要获取您的站点密钥和秘密密钥,您需要转到Google的reCAPTCHA设置页面

On the Google reCAPTCHA page, click the blue ‘Admin console’ button on the top right.

在Google reCAPTCHA页面上,点击右上角的蓝色“管理控制台”按钮。

The Google ReCAPTCHA admin console front page

If you’re not already logged into your G Suite account, then you’ll be prompted to login or create an account.

如果您尚未登录G Suite帐户 ,则会提示您登录或创建一个帐户。

Next, you’ll see a screen where you can register your site. You need to start by typing in a label for your site. This is for your own reference and will not be visible to users.

接下来,您会看到一个屏幕,您可以在其中注册您的网站。 您首先需要为您的网站输入标签。 这仅供您参考,对用户不可见。

After that you need to select ‘reCaptcha v2’ and the ‘I’m not a robot’ checkbox option.

之后,您需要选择“ reCaptcha v2”和“我不是机器人”复选框。

Selecting the 'reCAPTCHA v2' and 'I'm not a robot' checkbox

Next, enter your website’s domain name.

接下来,输入您的网站的域名

Your email address will already be present since you’re logged into your Google account. However, you can enter additional email addresses if you want.

自您登录Google帐户以来,您的电子邮件地址已经存在。 但是,您可以根据需要输入其他电子邮件地址。

After that, you need to check the box to accept the terms of service and click the ‘Submit’ button at the bottom of the page.

之后,您需要选中该框以接受服务条款,然后单击页面底部的“提交”按钮。

Filling in your site's details for Google reCAPTCHA

Next, you’ll see a page with a site key and secret key for your website.

接下来,您将看到一个包含网站密钥和网站密钥的页面。

Your site key and secret key from Google reCAPTCHA

You need to copy and paste the site key / secret key into your WPForms » Settings page in your WordPress dashboard. After that click on the ‘Save Settings’ at the bottom of that screen.

您需要将站点密钥/秘密密钥复制并粘贴到WordPress仪表板的WPForms»设置页面中。 之后,点击该屏幕底部的“保存设置”。

Entering your site key and secret key into WPForms

Now, you can add the reCAPTCHA checkbox to your contact form.

现在,您可以将reCAPTCHA复选框添加到您的联系表中。

Find your form under WPForms » All Forms and then click to edit it.

WPForms»所有表单下找到您的表单 ,然后单击以对其进行编辑。

Once inside the form builder, click on the ‘reCAPTCHA’ field on the left hand side. You’ll see a message that tells you that reCAPTCHA has been enabled for the form. Simply click the ‘OK’ button to continue.

进入表单生成器后,单击左侧的“ reCAPTCHA”字段。 您会看到一条消息,告诉您已为表单启用reCAPTCHA。 只需单击“确定”按钮即可继续。

The message saying that reCAPTCHA has been enabled

You’ll now see the reCAPTCHA logo at the top of your form.

现在,您将在表单顶部看到reCAPTCHA徽标。

The contact form with reCAPTCHA logo

Note: If you want to take reCAPTCHA off your form at any point, just click on the ‘reCAPTCHA’ field on the left again. You’ll see a message prompting you to confirm that you want to remove it.

注意:如果您想随时从表单中删除reCAPTCHA,只需再次单击左侧的'reCAPTCHA'字段即可。 您会看到一条消息,提示您确认要删除它。

Once you’re done, make sure you save your form, so you can then add it to your website.

完成后,请确保保存表单,以便随后将其添加到您的网站。

Adding Your Contact Form to Your Website

将您的联系表添加到您的网站

To add your form, go to your Contact page and click to add a new block. Select the ‘WPForms’ block by searching for it or by looking for it under ‘Widgets’.

要添加表单,请转到“联系人”页面,然后单击以添加新的阻止。 通过搜索或在“小部件”下查找来选择“ WPForms”块。

Adding your form to your contact page

Next, select your form from the dropdown list, and it’ll be added to your page.

接下来,从下拉列表中选择您的表单,它将添加到您的页面中。

Selecting the correct form from the dropdown list

When you preview or view your page, you should see the reCAPTCHA box at the bottom of your form.

预览或查看页面时,您应该在表单底部看到reCAPTCHA框。

Contact form with reCAPTCHA box

This should drastically reduce contact form spam on your website since it eliminates all automated spam submissions.

这将大大减少您网站上的联系表格垃圾邮件,因为它消除了所有自动提交垃圾邮件的行为。

3.使用Google Invisible reCAPTCHA阻止联系表单垃圾邮件 (3. Using Google Invisible reCAPTCHA to Block Contact Form Spam)

Some website owners don’t want their users to have to check a box in order to submit the contact form. This is where invisible reCAPTCHA comes in.

一些网站所有者不希望其用户必须选中复选框即可提交联系表。 这是看不见的reCAPTCHA出现的地方。

Invisible reCAPTCHA works just like the regular reCAPTCHA, except there’s no checkbox.

看不见的reCAPTCHA的工作方式与常规reCAPTCHA一样,只是没有复选框。

Instead, when the form is submitted, Google will determine whether it might be a bot submitting it. If so, Google will pop up the extra reCAPTCHA verification. If you want to see how it works, Google has a demo here.

取而代之的是,在提交表单后,Google会确定它是否可能是提交该表单的机器人。 如果是这样,Google将弹出额外的reCAPTCHA验证。 如果您想了解它的工作原理,请点击此处的Google演示

You can use invisible reCAPTCHA on your WPForms contact forms. It’s very similar to the process above for using a reCAPTCHA checkbox.

您可以在WPForms联系人表单上使用不可见的reCAPTCHA。 这与上面使用reCAPTCHA复选框的过程非常相似。

The first difference is that you need to select a different option when setting up reCAPTCHA with Google. Instead of picking the ‘I’m not a robot’ checkbox option, choose ‘Invisible reCAPTCHA badge’.

第一个区别是在使用Google设置reCAPTCHA时需要选择其他选项。 而不是选择“我不是机器人”复选框,而是选择“不可见的reCAPTCHA徽章”。

Selecting the invisible reCAPTCHA option in the Google admin panel

Next, when you go to WPForms » Settings and click the ‘reCAPTCHA’ tab, you’ll need to select the ‘Invisible reCAPTCHA v2’ option:

接下来,当您转到WPForms»设置并单击“ reCAPTCHA”选项卡时,您需要选择“ Invisible reCAPTCHA v2”选项:

Selecting the invisible reCAPTCHA option in WPForms

When you add the reCAPTCHA field to your contact form, it’ll now use the invisible reCAPTCHA. When users come to your form, it’ll look like this:

现在,当您将reCAPTCHA字段添加到联系表单时,它将使用不可见的reCAPTCHA。 当用户进入您的表单时,它将如下所示:

Contact form with the invisible reCAPTCHA active

The reCAPTCHA logo will always be on the bottom right of the screen.

reCAPTCHA徽标将始终位于屏幕的右下方。

If the user wants to know more about reCAPTCHA on your site, then they can click that logo. It’ll expand to show links to Google’s privacy policy and terms of service. You should also update your own site’s privacy policy.

如果用户想在您的网站上了解更多关于reCAPTCHA的信息,那么他们可以单击该徽标。 它将展开以显示指向Google隐私权政策和服务条款的链接。 您还应该更新自己网站的隐私政策。

Note: in the screenshot, you’ll see the option for reCAPTCHA v3, but we’re specifically not covering that since it has a lot of false positives and can block real users. We use and recommend reCAPTCHA v2 Checkbox option that we showed in our step 2 of the article.

注意:在屏幕截图中,您会看到reCAPTCHA v3的选项,但由于它有很多误报且会阻止实际用户,因此我们不专门介绍它。 我们使用并推荐在本文的步骤2中显示的reCAPTCHA v2 Checkbox选项。

4.使用自定义验证码阻止联系表单垃圾邮件 (4. Using Custom Captcha to Block Contact Form Spam)

Some website owners don’t want to use Google’s reCAPTCHA on their site due to privacy concerns, or they simply want something not branded.

出于隐私方面的考虑,某些网站所有者不想在自己的网站上使用Google的reCAPTCHA,或者他们只是想要一些没有品牌的东西。

In that case, you can use WPForms custom CAPTCHA addon which is part of the Pro plugin.

在这种情况下,您可以使用Pro插件中的WPForms 自定义CAPTCHA插件。

It lets you create custom math questions CAPTCHA or other custom questions that you can use as validation.

它使您可以创建自定义数学问题CAPTCHA或可用作验证的其他自定义问题。

To use this addon, you need to go to WPForms » Addons, find the Custom Captcha Addon, and click the ‘Install Addon’ button.

要使用此插件,您需要转到WPForms»插件 ,找到自定义验证码插件,然后单击“安装插件”按钮。

Installing the Custom Captcha addon

The addon should install then activate automatically.

该插件应安装后自动激活。

Once it’s installed, go to WPForms » All Forms and open up your contact form. Under ‘Fancy Fields’ you’ll find the ‘Captcha’ field.

安装完成后,转到WPForms»所有表单,然后打开您的联系表单。 在“花哨的字段”下,您会找到“验证码”字段。

Click on it and drag it onto your form. We recommend placing it just above the ‘Submit’ button.

单击它并将其拖动到您的窗体上。 我们建议将其放置在“提交”按钮上方。

Adding a custom captcha field to your form

If you want to change the Captcha field from the default math question, click on it and select the type of Captcha you want to use. The options are ‘Math’ or ‘Question and Answer’.

如果要更改默认数学问题的验证码字段,请单击它,然后选择要使用的验证码类型。 选项为“数学”或“问答”。

Changing the custom captcha question in WPForms

When you choose the Math option, WPForms will generate random math questions, so it’s less predictable.

当您选择“数学”选项时,WPForms将生成随机的数学问题,因此难以预测。

If you’re choosing Question and Answer option, then we recommend adding at least a few questions there, so it’s harder to predict since WPForms will rotate them randomly.

如果您选择“问题和答案”选项,那么我们建议您至少在其中添加一些问题,因此很难预测,因为WPForms会随机旋转它们。

Once you’re happy with your form, save it, then add it to your Contact page. You can do so by creating a ‘WPForms’ block, as shown in the reCAPTCHA checkbox method.

对表单满意后,将其保存,然后将其添加到“联系人”页面。 您可以通过创建一个“ WPForms”块来实现,如reCAPTCHA复选框方法所示。

5.防止垃圾邮件机器人看到您的表单 (5. Prevent Spam Bots From Seeing Your Form)

Perhaps you don’t want to use reCAPTCHA or a custom captcha field on your form.

也许您不想在表单上使用reCAPTCHA或自定义验证码字段。

Another way to prevent contact form spam is to stop bots from seeing your form. You could do this using password protection, or by only showing your form to registered users of your WordPress membership site.

防止联系表单垃圾邮件的另一种方法是阻止漫游器看到您的表单。 您可以使用密码保护或仅向WordPress会员站点的注册用户显示表单来执行此操作。

These methods might be overkill for your regular contact form, but they could work well in other situations.

这些方法对于您的常规联系表可能有些过分,但是在其他情况下它们可能会很好用。

For instance, if you run a monthly Q&A for your email newsletter subscribers, you could create a form for them to submit questions.

例如,如果您为电子邮件通讯订阅者每月进行一次问答,则可以为他们创建一个表单以提交问题。

Password Protecting Your Form Using WordPress’ Visibility Options

使用WordPress的可见性选项密码保护您的表单

This is a quick way to password protect your contact page.

这是密码保护您的联系页面的快速方法。

Go to the ‘Publish’ settings for your page then set the visibility to ‘Password Protected’. Pick a password for your page. This will be the same for all users.

转到页面的“发布”设置,然后将可见性设置为“受密码保护”。 选择页面密码。 这对于所有用户都是相同的。

Password protecting your contact page

When you publish your page, it’ll look like this when people first arrive there. They’ll need to enter the password to see the page and the contact form.

当您发布页面时,人们首次到达该页面时,它会看起来像这样。 他们需要输入密码才能看到页面和联系表。

The contact page now shows 'Protected: Contact Us' as the title and requires a password

Once they’ve entered the password, they can use your form as normal.

输入密码后,他们可以照常使用您的表单。

There are a couple of drawbacks to this method.

这种方法有两个缺点。

First, your page will show the default WordPress message. This reads, “To view this protected post, enter the password below.” It isn’t easy to edit this.

首先,您的页面将显示默认的WordPress消息。 内容为:“要查看此受保护的帖子,请在下面输入密码。” 编辑它并不容易。

Second, your whole page will be protected, not just your form. This could be annoying if you want to have some content, such as FAQs, visible to all users.

其次,您的整个页面将受到保护,而不仅仅是您的表单。 如果您想让所有用户都可以看到一些内容,例如常见问题,这可能会很烦人。

Password Protecting Your Form Using a WPForms Addon

使用WPForms插件保护您的表单的密码

If you’re using the Pro version of WPForms, then you can install the Form Locker addon which lets you password protect your form itself, not your whole page.

如果您使用的是WPForms Pro版本,则可以安装Form Locker插件,该插件可以用密码保护表单本身,而不是整个页面。

To install it, go to WPForms » Addons. Find the Form Locker Addon and click ‘Install Addon’. It should automatically activate.

要安装它,请转到WPForms»Addons 。 找到Form Locker插件,然后单击“安装插件”。 它应该自动激活。

Installing the Form Locker addon for WPForms

Next, find the form you want to protect under WPForms » All Forms. Click on it to edit it.

接下来,在WPForms»All Forms下找到要保护的表单 。 单击它进行编辑。

Go to Settings » Form Locker. Check the ‘Enable Password Protection’ box and you’ll then see the options to enter your password and your message.

转到“设置”»“表单锁” 。 选中“启用密码保护”框,然后您将看到用于输入密码和消息的选项。

Enabling password protecting using Form Locker

Your contact page will now be visible to all users, with just the contact form hidden. The form will look like this before the password is entered:

现在,所有用户都可以看到您的联系页面,只是隐藏了联系表单。 在输入密码之前,该表格将如下所示:

How your contact form looks to users before they enter the password

Showing Your Contact Page Only to Registered Users

仅向注册用户显示您的联系页面

A final method is to only let users access your contact form if they’ve registered on your site. You could use a membership site plugin and protect your contact page so it can only be viewed by logged-in members.

最后一种方法是仅让用户在您的网站上注册后才能访问您的联系表。 您可以使用会员网站插件并保护您的联系页面,以便只有登录会员才能查看。

This is a great option if you want to offer a specific service to members only. There are several great membership site plugins you could use to do this.

如果您只想为会员提供特定服务,这是一个很好的选择。 您可以使用几个很棒的会员网站插件来做到这一点。

We hope this article has helped you learn how to block contact form spam in WordPress. You may also want to see our guide on how to create a business email address and our comparison of the best business phone services.

我们希望本文能帮助您学习如何在WordPress中阻止联系表单垃圾邮件。 您可能还需要查看有关如何创建公司电子邮件地址的指南, 以及有关最佳公司电话服务的比较

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-block-contact-form-spam-in-wordpress/

wordpress表单调用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值