减少cookie传输

A growing site comes with new challenges and one of them is comment spam. Thankfully, there are plenty of solutions to effectively fight comment spam. For example, using Akismet you can effectively reduce comment spam. You can also use CAPTCHA to block spamming bots. In this article, we will show you how to reduce WordPress comment spam with Cookies for Comments.

一个不断发展的网站面临着新的挑战,其中之一就是垃圾评论 。 值得庆幸的是,有许多解决方案可以有效地打击垃圾评论 。 例如, 使用Akismet,您可以有效地减少垃圾评论。 您还可以使用CAPTCHA阻止垃圾邮件机器人。 在本文中,我们将向您展示如何使用Cookies for Comments减少WordPress评论垃圾邮件。

First thing you need to do is install and activate the Cookies for Comments plugin. The plugin works out of the box and there are no settings for you to configure.

您需要做的第一件事是安装并激活Cookies for Comments插件。 该插件可以直接使用,没有可供您配置的设置。

评论Cookie如何工作? (How Cookies for Comments Work?)

Most of the comment spam is submitted by spam bots. These spam bots are basically software scripts that crawl the web looking for comment forms and then submit spam comments.

大多数评论垃圾邮件是由垃圾邮件机器人提交的。 这些垃圾邮件机器人基本上是一种软件脚本,可在网络上爬行以查找评论表单,然后提交垃圾邮件评论。

To spam thousands of websites, these programs don’t load images and stylesheets. The text on a page is enough for them to determine the presence of a comment form.

为了向成千上万的网站发送垃圾邮件,这些程序不会加载图像和样式表。 页面上的文本足以使他们确定评论表单的存在。

Cookies for comments plugin loads a stylesheet or an image when a page on your WordPress site is accessed. If the user’s browser downloads the stylesheet or image file, then the plugin sets a cookie in the user’s browser.

当您访问WordPress网站上的页面时,用于注释的Cookie插件将加载样式表或图像。 如果用户的浏览器下载了样式表或图像文件,则插件将在用户的浏览器中设置cookie。

The plugin checks for the cookie when any user tries to post a comment. If the cookie exists, then this means that the user is not a spam bot.

当任何用户尝试发表评论时,插件都会检查cookie。 如果该cookie存在,则意味着该用户不是垃圾邮件漫游器。

If the cookie does not exist, then the user is most likely a spam bot, and the comment they submit is marked as spam.

如果cookie不存在,则该用户很可能是垃圾邮件漫游器,并且他们提交的评论被标记为垃圾邮件。

如何从评论中完全阻止垃圾邮件机器人 (How To Completely Stop The Spam Bots From Commenting)

Cookies for Comments will successfully detect spammers, but it will let them post a comment. This comment goes into spam comments. With little more effort, you can stop the bots from posting a comment altogether.

评论用Cookie可以成功检测到垃圾邮件发送者,但可以使他们发布评论。 此评论将成为垃圾评论。 只需付出更多努力,您就可以完全阻止僵尸程序发表评论。

To do that, you will need to find out the cookie value. Right click anywhere on the your website, and then select View Page Source.

为此,您需要找出Cookie值。 右键单击网站上的任意位置,然后选择查看页面源

This will open a new tab in your browser showing the page’s HTML source. You need to scroll down to the bottom of the page until you find a line similar to this one:

这将在浏览器中打开一个新标签,显示页面HTML源。 您需要向下滚动到页面底部,直到找到与此相似的行:


<img alt='css.php' src="http://example.com/wp-content/plugins/cookies-for-comments/css.php?k=9692e3a737ecafe8fe6329490410ff50&amp;o=i&amp;t=201927728" width='1' height='1' />

The value after css.php?k= is the value of the cookie. Like in this example, it is 9692e3a737ecafe8fe6329490410ff50. You will need this value in the next step.

css.php?k=之后的值是cookie的值。 像此示例一样,它是9692e3a737ecafe8fe6329490410ff50 。 下一步将需要此值。

Now you need to connect to your website using an FTP client and edit the .htaccess file. Simply paste this code before anything else in your .htaccess file.

现在,您需要使用FTP客户端连接到您的网站并编辑.htaccess文件。 只需将此代码粘贴在.htaccess文件中的其他任何内容之前。


RewriteCond %{HTTP_COOKIE} !^.*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.*$
RewriteRule ^wp-comments-post.php - [F,L]

You need to replace XXX with the cookie value.

您需要将Cookie值替换为XXX。

That’s all. Your .htaccess file will now look for a cookie value and when it is not found, it will stop the user from commenting.

就这样。 您的.htaccess文件现在将查找cookie值,当找不到该cookie值时,它将阻止用户发表评论。

We hope this article helped you reduce WordPress comment spam on your site.

我们希望本文能帮助您减少网站上的WordPress评论垃圾邮件。

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

如果您喜欢这篇文章,请订阅我们的YouTube频道,以获取更多WordPress视频教程。 您也可以在Twitter和Google+上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-reduce-wordpress-comment-spam-with-cookies-for-comments/

减少cookie传输

减少cookie传输_如何使用Cookie减少WordPress垃圾评论相关推荐

  1. wordpress评论框_如何通过过滤和阻止它们来抵御WordPress垃圾评论

    wordpress评论框 I use WordPress as my blogging platform. It's awesome and used by millions of websites. ...

  2. mysql减少锁等待_降低锁竞争 减少MySQL用户等待时间

    [IT168 技术]通过锁机制,可以实现多线程同时对某个表进行操作.如下图所示,在某个时刻,用户甲.用户乙.用户丙可能会同时或者先后(前面一个作业还没有完成)对数据表A进行查询或者更新的操作.当某个线 ...

  3. spark减少内存消耗_将内存消耗减少20倍

    spark减少内存消耗 这将是另一个故事,与我们分享有关内存相关问题的最新经验. 该案例是从最近的客户支持案例中提取的,在该案例中,我们遇到了一个行为异常严重的应用程序,该应用程序因生产中的OutOf ...

  4. E站账号cookie分享_产品经理必懂知识点—cookie和session

    作为一个产品经理,如果不了解cookie和session很难设计好产品,尤其对于网站产品经理而言,cookie和session是一个必须要懂的知识点.如果在中大型企业做产品经理,这个cookie和se ...

  5. java 中cookie是什么_什么是cookie?

    为什么要用Cookie 浏览器与WEB服务器之间是使用HTTP协议进行通讯的,而HTTP协议本身是无状态的.什么是无状态呢,即服务器无法判断浏览器身份,即无论浏览器是否已经访问过,服务器都会当成第一次 ...

  6. remmima 不能保存_Vue项目实现表单登录页保存账号和密码到cookie功能_婳祎_前端开发者...

    实现功能: 1.一周内自动登录勾选时,将账号和密码保存到cookie,下次登陆自动显示到表单内 2.点击忘记密码则清空之前保存到cookie的值,下次登陆需要手动输入 次要的就不说了直接上主要的代码 ...

  7. python爬虫判断cookie过期_当爬虫遇到cookie失效,怎样处理?

    之前使用爬虫时,最让我头疼的就是cookie失效的问题了.由于有的cookie存在时效问题.一段时间后,cookies会失效.失效后,爬虫碰到的页面就基本上是重新登录的页面了.这时候就需要cookie ...

  8. 爬虫cookie过期_【Python】Scrapy爬虫框架之Request和Response

    说明 Scrapy的Request和Response对象用于爬取网站. HTTP是无状态的面向连接的协议, 为了保持连接状态, 引入了Cookie机制 Cookie是http消息头中的一种属性,包括: ...

  9. Cookie和Session-学习笔记02【Cookie案例、JSP改造Cookie案例】

    Java后端 学习路线 笔记汇总表[黑马程序员] Cookie和Session-学习笔记01[Cookie_快速入门.Cookie_细节] Cookie和Session-学习笔记02[Cookie案例 ...

最新文章

  1. 在耗时操作结束之前 销毁tableView 如何让tableViewCell 销毁
  2. telegram bot 机器人 发送 加粗 斜体 字体
  3. 推荐系统炼丹笔记:EdgeRec阿里边缘计算推荐系统
  4. JavaScript之BOM基础
  5. 刨根问底HTTP和WebSocket协议
  6. FMS飞行模拟器简介
  7. Esp8266板制作WiFi干扰器
  8. MASM 32位汇编 32与16汇编区别
  9. python什么叫索引_python字典的索引是什么
  10. 面试:设计一个电商平台积分兑换系统
  11. python基础练习题:纳特拼音alaphabeta【难度:1级】--景越Python编程实例训练营,不同难度Python习题,适合自学Python的新手进阶
  12. Linux模块(2) - 创建设备节点
  13. 1024程序员节!Hello world
  14. 如何让博文在百度上被搜索到
  15. php 数据库 无限级菜单,php实现无限级树型菜单(函数递归算法)[一]
  16. 冒泡排序(C语言版)
  17. optics算法matlab实现,OPTICS聚类算法的matlab实现
  18. 用故事讲清楚统计学的Confidence Interval(置信区间)and Hypothesis Test
  19. electron-egg使用
  20. Day1-介绍、基本语法、流程控制

热门文章

  1. 华为LAB实验室-书本识别
  2. Python学习4:计算几何形状的表面积与体积
  3. 数学——埃氏筛与线性筛
  4. 三电平buck变换器仿真模型 采用PWM控制方式 模型内包含开环控制和闭环控制
  5. ant批量修改文件名_Ant Renamer(文件批量重命名)
  6. 西安android工资,【华为西安研究所工资】android开发工程师待遇-看准网
  7. 为什么MCU晶体两边要各接一个对地电容?
  8. 中控考勤机软件 v5.0绿色版
  9. 用迭代和递归方式分别写一个兔子生育的python程序(斐波那契数列)
  10. WebStorm安装方法