Contact form 7增加防垃圾询盘功能
垃圾邮件是外贸人士公敌,今天来讲下Contact form 7增加防垃圾询盘功能的方法
1. 简单的初级方法
针对很多群发的无内容的空白垃圾邮件,可以在cf7表单设置那里加一个强制填写的功能即可预防,方法是在需要修改的表单的form选项里面,把textarea后面加一个*号,然后保存即可,如下图所示。*号代表要求填写内容

2. 使用akismet插件防垃圾询盘
如果有收到很多群发的垃圾广告询盘,可以优先采用此方法
1)安装akismet插件,并激活
直接搜索akismet,并安装和激活

2)获取Akismet插件的api key

点击akismet下面的,settings,会跳转到akismet的页面,点击Get your api key


接下来需要你注册一个wordpress.com的账号,如果你已经有wordpress.com的账号,直接登录即可

接下来会跳转到api key的选择页面(如果没有跳转,在后台找一下也可以找到),直接点击basic下面的get basic

接下来会跳转到付款页面,不用急,直接把akismet basic下面的价格拖到0,然后再点Continue,不用付钱

接下来会弹出这个提示,因它侦测到你是从你的网站后台进入akismet页面的,直接点击activate this即可

然后它会跳转到你的网站后台,而且自动帮你填好了申请的api key,你只需要把strictness选择为always put spam in the spam folder for review,然后 save changes即可。

3)在contact form 7中插入akismet的防垃圾代码,并保存
进入你需要加入防垃圾代码的表单,在form菜单里面添加
akismet:author 插入your-name后面,要留空格
akismet:author_email 插入your-email后面,要留空格
akismet:author_url 插入your-url后面,要留空格
然后保存表单。
以上三个代码是分别对表单的名字,邮箱和url进行过滤,可谓三重防护,这样垃圾询盘就会少很多。

添加google防垃圾验证到cf7表单中,可以全面的防止垃圾邮件和询盘,具体操作方法如下
3. 在contact form 7中加入google recaptcha防垃圾询盘
注意,此方法由于加载了一些外部的文件,所以会对页面的速度有一定的影响
以下是详细步骤
1)获取google captcha key
进入Google captcha注册页面,点击右上角get recaptcha

有gmail账号的会自动跳转到以下页面,没有gmail账号的需要注册一个才能使用
如下图,在label填上网上名字,在domains下面填上域名,可以填多个域名,填好后点击register

接着会跳转到获取页面, 保存site key 和 secret key这两段个字符

并在最下面的点save changes

2) 注册captcha key到contact form 7
进入后台 - contact - integration, 点击configure keys

分别填入site key和secret key,并点击Save,即可注册完成

3)加入captcha到contact form 7 表单中
进入表单的编辑页面,定位光标到需要插入captcha的位置(一般在发送前面),并点击菜单上的recaptcha

在弹开的窗口中可以进行相关设置,一般保持默认就可以,并点击insert tag

可以看到recaptcha的tag已经加入了,点击SAVE

在前台表单处刷新就可以看到添加google验证码成功, 验证码要在FQ状态下才可以看到
总结
以上的三个contact form 7防垃圾邮件方法,第二种和第三种选择一种就行,同时安装。 Hunk的网站用了之后,就很少收到垃圾询盘了。