{"id":129,"date":"2020-12-13T17:15:33","date_gmt":"2020-12-13T11:15:33","guid":{"rendered":"http:\/\/www.dreamflier.net\/wordpress\/?p=129"},"modified":"2020-12-13T17:36:35","modified_gmt":"2020-12-13T11:36:35","slug":"%e7%ae%80%e5%8d%95%e4%bf%ae%e6%94%b9%e5%b0%b1%e8%83%bd%e9%98%b2%e6%ad%a2wordpress%e5%9e%83%e5%9c%be%e8%af%84%e8%ae%ba%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.jichangqing.net\/wordpress\/?p=129","title":{"rendered":"\u7b80\u5355\u4fee\u6539\u5c31\u80fd\u9632\u6b62WordPress\u5783\u573e\u8bc4\u8bba\u7684\u65b9\u6cd5"},"content":{"rendered":"<p style=\"color: #444444;\">\u6211\u60f3\u5f88\u591a\u4f7f\u7528WordPress\u7684\u4eba\u90fd\u5e94\u8be5\u5bf9\u7684\u5783\u573e\u8bc4\u8bba\u6df1\u6076\u75db\u7edd\u5427\uff0c\u7136\u540e\u5c31\u5f00\u59cb\u4e86\u5783\u573e\u8bc4\u8bba\u4e0e\u53cd\u5783\u573e\u8bc4\u8bba\u7684\u4e89\u593a\u6218\uff0c\u7136\u540e\u7ed9\u535a\u5ba2\u5b89\u88c5\u5404\u5f0f\u5404\u6837\u7684\u9632\u5783\u573e\u8bc4\u8bba\u7684\u63d2\u4ef6\uff0c\u4f46\u662f\u5f80\u5f80\u8fd8\u662f\u9632\u4e0d\u80dc\u9632\u3002<\/p>\n<p style=\"color: #444444;\">\u5bf9\u4e8e\u666e\u901a\u7528\u6237\u800c\u8a00\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4e0d\u7ba1\u4f60\u4f7f\u7528\u7684\u4ec0\u4e48\u4e3b\u9898\uff0c\u901a\u7528\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\uff1a<\/p>\n<p style=\"color: #444444;\">\u5c06\u535a\u5ba2\u6839\u76ee\u5f55\u4e0b\u9762\u7684wp-comments-post.php\u6539\u540d\uff0c\u6539\u6210\u4ec0\u4e48\u90fd\u53ef\u4ee5\uff0c\u6bd4\u5982 no-comments-post.php<\/p>\n<p style=\"color: #444444;\">\u6253\u5f00\u4e3b\u9898\u7684\u91cc\u9762\u7684comments.php\uff0c\u627e\u5230\u4ee3\u7801\u91cc\u9762\u7684 wp-comments-post.php \uff0c\u5c06\u5176\u6539\u4e3a no-comments-post.php<\/p>\n<p style=\"color: #444444;\">\u6539\u7684\u540d\u5b57\u8ddf\u4e4b\u524d\u4fee\u6539\u7684\u540d\u5b57\u4e00\u6837\u5c31\u884c\u4e86\uff0c\u5efa\u8bae\u6539\u7684\u4e0d\u8981\u8fd9\u4e48\u89c4\u5219\uff0c\u9632\u6b62\u5783\u573e\u8bc4\u8bba\u53d1\u5e03\u673a\u5236\u5347\u7ea7\u901a\u8fc7\u4ec0\u4e48\u6b63\u5219\u5339\u914d\u6765\u731c\u67d0\u4e9b\u7c7b\u4f3c\u7684\u5730\u5740\u3002<\/p>\n<p style=\"color: #444444;\">\u8fd9\u4e2a\u4e3b\u8981\u5c31\u662f\u901a\u8fc7\u4fee\u6539\u8bc4\u8bba\u8def\u5f84\uff0c\u8ba9\u5783\u573e\u8bc4\u8bba\u53d1\u8868\u627e\u4e0d\u5230\u5165\u53e3\uff0c\u4ece\u800c\u5c4f\u853d\u5783\u573e\u8bc4\u8bba\uff0c\u76ee\u524d\u6211\u4f7f\u7528\u4e0b\u6765\u8fd8\u662f\u5f88\u4e0d\u9519\u7684\uff0c\u5982\u679c\u4f60\u7684WordPress\u4e5f\u6709\u5f88\u591a\u5783\u573e\u8bc4\u8bba\uff0c\u4e0d\u59a8\u4e5f\u7528\u7528\u8fd9\u4e2a\u65b9\u6cd5\u3002<\/p>\n<p style=\"color: #444444;\">from:https:\/\/www.weisay.com\/blog\/prevent-spam-for-wordpress.html<\/p>\n<h1 class=\"entry-title\" style=\"color: #333333;\"><span class=\"title-text\">\u9650\u5236WordPress\u8bc4\u8bba\u5185\u5bb9\u7684\u6700\u5c0f\u5b57\u6570<\/span><\/h1>\n<p>\u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u5f53\u524dWordPress\u4e3b\u9898\u7684 functions.php \u6587\u4ef6\uff1a<\/p>\n<div class=\"wp_syntax\" style=\"color: #110000;\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre style=\"color: #5c5c5c !important;\">1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"php\">add_filter<span style=\"color: #009900;\">(<\/span> <span style=\"color: #0000ff;\">'preprocess_comment'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'minimal_comment_length'<\/span> <span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"font-weight: bold; color: #000000;\">function<\/span> minimal_comment_length<span style=\"color: #009900;\">(<\/span> <span style=\"color: #000088;\">$commentdata<\/span> <span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span>\r\n\t<span style=\"color: #000088;\">$minimalCommentLength<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">20<\/span><span style=\"color: #339933;\">;<\/span>\r\n\t<span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">(<\/span> <span style=\"color: #990000;\">strlen<\/span><span style=\"color: #009900;\">(<\/span> <span style=\"color: #990000;\">trim<\/span><span style=\"color: #009900;\">(<\/span> <span style=\"color: #000088;\">$commentdata<\/span><span style=\"color: #009900;\">[<\/span><span style=\"color: #0000ff;\">'comment_content'<\/span><span style=\"color: #009900;\">]<\/span> <span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">)<\/span> <span style=\"color: #339933;\">&lt;<\/span> <span style=\"color: #000088;\">$minimalCommentLength<\/span> <span style=\"color: #009900;\">)<\/span>\r\n        <span style=\"color: #009900;\">{<\/span>\r\n\t\twp_die<span style=\"color: #009900;\">(<\/span> <span style=\"color: #0000ff;\">'\u62b1\u6b49\uff0c\u60a8\u7684\u8bc4\u8bba\u592a\u77ed\u4e86\uff0c\u8bf7\u81f3\u5c11\u8f93\u5165 '<\/span> <span style=\"color: #339933;\">.<\/span> <span style=\"color: #000088;\">$minimalCommentLength<\/span> <span style=\"color: #339933;\">.<\/span> <span style=\"color: #0000ff;\">' \u4e2a\u5b57\uff01'<\/span> <span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span>\r\n        <span style=\"color: #009900;\">}<\/span>\r\n\t<span style=\"color: #b1b100;\">return<\/span> <span style=\"color: #000088;\">$commentdata<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #009900;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u6ce8\uff1a\u8bf7\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u4fee\u6539\u7b2c\u4e09\u884c\u7684\u6570\u5b57\u3002<\/p>\n<p>https:\/\/www.wpdaxue.com\/set-wordpress-minimal-comment-limit.html<\/p>\n<p>&nbsp;<\/p>\n<h1 class=\"entry-title h3\">wordpress\u5783\u573e\u8bc4\u8bba\u6e05\u9664\u529e\u6cd5\uff0c\u5feb\u901f\u6279\u91cf\u5220\u9664<\/h1>\n<p>&nbsp;<\/p>\n<p>\u6253\u5f00PhpMyAdmin \uff0c\u8fdb\u5165wordpress\u6570\u636e\u5e93\u7ba1\u7406\uff0c\u901a\u8fc7\u4ee5\u4e0b SQL \u547d\u4ee4\u6765\u5220\u9664\uff1a<\/p>\n<pre>delete from wp_comments where comment_approved = '\u53c2\u6570'<\/pre>\n<p>wp_comments\u662fWP\u9ed8\u8ba4\u7684\u8bc4\u8bba\u8868\uff0c\u8bf7\u6839\u636e\u81ea\u5df1\u7684\u5b9e\u9645\uff0c\u4fee\u6539\u524d\u9762\u7684 wp_ \u4e3a\u4f60\u7684\u6570\u636e\u5e93\u8868\u524d\u7f00\u3002<\/p>\n<p>\u201c\u53c2\u6570\u201d\u67093\u4e2a\u9009\u9879\uff1a<\/p>\n<ul>\n<li>spam: \u5783\u573e\u8bc4\u8bba<\/li>\n<li>0: \u672a\u5ba1\u6838\u8bc4\u8bba<\/li>\n<li>1: \u5df2\u5ba1\u6838\u8bc4\u8bba<\/li>\n<\/ul>\n<p>\u5982\u679c\u8981\u5220\u9664\u5f85\u5ba1\u6838\u8bc4\u8bba\uff0c\u53c2\u6570\u90a3\u91cc\u5c31\u4fee\u6539\u4e3a 0 \u5373\u53ef\u3002<\/p>\n<p>\u5982\u679c\u4e0d\u4f1a\u64cd\u4f5c\u6570\u636e\u5e93\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u63d2\u4ef6\u00a0<a href=\"http:\/\/wordpress.org\/plugins\/delete-pending-comments\/\" target=\"_blank\" rel=\"nofollow\">Delete All Pending Comments<\/a><\/p>\n<p>http:\/\/qitiancom.com\/archives\/1721<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u60f3\u5f88\u591a\u4f7f\u7528WordPress\u7684\u4eba\u90fd\u5e94\u8be5\u5bf9\u7684\u5783\u573e\u8bc4\u8bba\u6df1\u6076\u75db\u7edd\u5427\uff0c\u7136\u540e\u5c31\u5f00\u59cb\u4e86\u5783\u573e\u8bc4\u8bba\u4e0e\u53cd\u5783\u573e\u8bc4\u8bba\u7684\u4e89\u593a\u6218\uff0c\u7136\u540e\u7ed9\u535a\u5ba2\u5b89\u88c5\u5404\u5f0f\u5404\u6837\u7684\u9632\u5783\u573e\u8bc4\u8bba\u7684\u63d2\u4ef6\uff0c\u4f46\u662f\u5f80\u5f80\u8fd8\u662f\u9632\u4e0d\u80dc\u9632\u3002 \u5bf9\u4e8e\u666e\u901a\u7528\u6237\u800c\u8a00\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4e0d\u7ba1\u4f60\u4f7f\u7528\u7684\u4ec0\u4e48\u4e3b\u9898\uff0c\u901a\u7528\u7684\u89e3\u51b3\u65b9\u6cd5\u662f &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":4,"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":133,"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions\/133"}],"wp:attachment":[{"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jichangqing.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}