{"id":1610,"date":"2009-10-19T02:51:24","date_gmt":"2009-10-18T18:51:24","guid":{"rendered":"https:\/\/www.wopus.org\/?p=1610"},"modified":"2009-10-19T02:51:24","modified_gmt":"2009-10-18T18:51:24","slug":"wordpress%e7%a6%81%e6%ad%a2%e8%9c%98%e8%9b%9b%e6%8a%93%e5%8f%96%e6%9f%90%e6%97%a5%e5%bf%97","status":"publish","type":"post","link":"https:\/\/wopus.org\/?p=1610","title":{"rendered":"WordPress\u7981\u6b62\u8718\u86db\u6293\u53d6\u67d0\u65e5\u5fd7"},"content":{"rendered":"<p>WordPress \u7684\u65e5\u5fd7\u516c\u5f00\u5ea6\u5206\u4e3a\u516c\u5f00\u3001\u5bc6\u7801\u4fdd\u62a4\u3001\u79c1\u4eba\u8fd9\u4e09\u7c7b\u8fd8\u4e0d\u662f\u5f88\u5b8c\u5584\uff0c\u5e94\u8be5\u8fd8\u53ef\u4ee5\u5206\u51fa\u4e00\u7c7b\uff1a\u534a\u516c\u5f00\u3002\u4e5f\u5c31\u662f\u8bf4\u67d0\u7bc7\u65e5\u5fd7\u5141\u8bb8\u670b\u53cb\u901a\u8fc7\u53cb\u60c5\u94fe\u63a5\u3001RSS \u8ba2\u9605\u6216\u8005\u5176\u4ed6\u641c\u7d22\u4ee5\u5916\u7684\u65b9\u5f0f\u8bbf\u95ee\uff0c\u4f46\u662f\u8fd9\u7bc7\u65e5\u5fd7\u5c06\u4e0d\u88ab\u641c\u7d22\u5f15\u64ce\u6536\u5f55\u3002\u6211\u60f3\u5230\u7684\u7b2c\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848\u5c31\u662f\u7528 robots.txt\uff0c\u4f46\u662f\u6bcf\u6b21\u5199\u534a\u516c\u5f00\u65e5\u5fd7\u90fd\u8981\u66f4\u65b0 robots.txt \u6709\u4e9b\u9ebb\u70e6\uff0c\u800c\u4e14\u6211\u4e0d\u5e0c\u671b robots.txt \u6587\u4ef6\u7279\u522b\u5197\u957f\u3002\u4e8e\u662f\u7b2c\u4e8c\u4e2a\u89e3\u51b3\u65b9\u6848\u8bde\u751f\u4e86\uff0c\u90a3\u5c31\u662f\u7528\u5f3a\u5927\u7684\u81ea\u5b9a\u4e49\u57df\uff0c\u65b9\u6cd5\u548c\u4e4b\u524d\u63d0\u5230\u7684\u9996\u9875\u7f29\u7565\u56fe\u6709\u76f8\u4f3c\u4e4b\u5904\u3002<\/p>\n<p><strong>\u9996\u5148\u5728 header.php \u4e2d\u7684 <head><\/head> \u4e4b\u95f4\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/strong><\/p>\n<blockquote><p>< ?php $private = get_post_meta($post->ID, &#8216;noindex&#8217;, true);<br \/>\n    if (!empty($private)) {<br \/>\n    echo &#8216;<meta name=\"robots\" content=\"noindex\"\/>&#8216;;<br \/>\n}<br \/>\n?><\/p><\/blockquote>\n<p>\u7136\u540e\u5728\u65e5\u5fd7\u7f16\u8f91\u5668\u4e2d\u6dfb\u52a0\u65b0\u81ea\u5b9a\u4e49\u57df\uff0c\u540d\u79f0\u4e3a private\uff0c\u503c\u53ef\u4ee5\u662f\u4efb\u610f\u975e\u7a7a\u5b57\u7b26\u4e32\uff0c\u5efa\u8bae\u7528 post id\u3002\u7981\u6b62\u641c\u7d22\u5f15\u64ce\u6536\u5f55\u534a\u516c\u5f00\u7684\u5355\u7bc7\u65e5\u5fd7\u5c31\u8fd9\u4e48\u5b9e\u73b0\u5566\u3002<\/p>\n<p>\u3000\u3000\u6700\u540e\u8865\u5145\u8bf4\u660e\u4e00\u4e0b\uff0cnoindex \u6807\u7b7e\u662f\u4e92\u8054\u7f51 meta robots \u534f\u8bae\u7684\u5176\u4e2d\u4e4b\u4e00\uff0cGoogle \u548c Yahoo \u8fd9\u7c7b\u641c\u7d22\u5f15\u64ce\u90fd\u4f1a\u4e2d\u89c4\u4e2d\u77e9\u5730\u6309\u8fd9\u4e2a\u534f\u8bae\u6267\u884c\uff0c\u552f\u72ec\u767e\u5ea6\u4e0d\u9e1f noindex \u8fd9\u4e2a\u6807\u7b7e\uff0c\u63a5\u4e0b\u6765 BS \u767e\u5ea6\u7684\u8bdd\u6211\u5c31\u4e0d\u591a\u8bf4\u4e86\uff0c\u7559\u7ed9\u7ae5\u978b\u4eec\u5728\u8bc4\u8bba\u4e2d\u81ea\u7531\u53d1\u6325\u54af\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress \u7684\u65e5\u5fd7\u516c\u5f00\u5ea6\u5206\u4e3a\u516c\u5f00\u3001\u5bc6\u7801\u4fdd\u62a4\u3001\u79c1\u4eba\u8fd9\u4e09\u7c7b\u8fd8\u4e0d\u662f\u5f88\u5b8c\u5584\uff0c\u5e94\u8be5\u8fd8\u53ef\u4ee5\u5206\u51fa\u4e00\u7c7b\uff1a\u534a\u516c\u5f00\u3002\u4e5f\u5c31\u662f\u8bf4\u67d0\u7bc7\u65e5\u5fd7\u5141\u8bb8\u670b\u53cb\u901a\u8fc7\u53cb\u60c5\u94fe\u63a5\u3001RSS \u8ba2\u9605\u6216\u8005\u5176\u4ed6\u641c\u7d22\u4ee5\u5916\u7684\u65b9\u5f0f\u8bbf\u95ee\uff0c\u4f46\u662f\u8fd9\u7bc7\u65e5\u5fd7\u5c06\u4e0d\u88ab\u641c\u7d22\u5f15\u64ce\u6536\u5f55\u3002\u6211\u60f3\u5230\u7684\u7b2c\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848\u5c31\u662f\u7528 robots.txt\uff0c\u4f46\u662f\u6bcf\u6b21\u5199\u534a\u516c\u5f00\u65e5\u5fd7\u90fd\u8981\u66f4\u65b0 robots.txt \u6709\u4e9b\u9ebb\u70e6\uff0c\u800c\u4e14\u6211\u4e0d\u5e0c\u671b robots.txt \u6587\u4ef6\u7279\u522b\u5197\u957f\u3002\u4e8e\u662f\u7b2c\u4e8c\u4e2a\u89e3\u51b3\u65b9\u6848\u8bde\u751f\u4e86\uff0c\u90a3\u5c31\u662f\u7528\u5f3a\u5927\u7684\u81ea\u5b9a\u4e49\u57df\uff0c\u65b9\u6cd5\u548c\u4e4b\u524d\u63d0\u5230\u7684\u9996\u9875\u7f29\u7565\u56fe\u6709\u76f8\u4f3c\u4e4b\u5904\u3002 \u9996\u5148\u5728 header.php \u4e2d\u7684 \u4e4b\u95f4\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a < ?php $private = get_post_meta($post->ID, &#8216;noindex&#8217;, true); if (!empty($private)) { echo &#8216;&#8216;; } ?> \u7136\u540e\u5728\u65e5\u5fd7\u7f16\u8f91\u5668\u4e2d\u6dfb\u52a0\u65b0\u81ea\u5b9a\u4e49\u57df\uff0c\u540d\u79f0\u4e3a private\uff0c\u503c\u53ef\u4ee5\u662f\u4efb\u610f\u975e\u7a7a\u5b57\u7b26\u4e32\uff0c\u5efa\u8bae\u7528 post id\u3002\u7981\u6b62\u641c\u7d22\u5f15\u64ce\u6536\u5f55\u534a\u516c\u5f00\u7684\u5355\u7bc7\u65e5\u5fd7\u5c31\u8fd9\u4e48\u5b9e\u73b0\u5566\u3002 \u3000\u3000\u6700\u540e\u8865\u5145\u8bf4\u660e\u4e00\u4e0b\uff0cnoindex \u6807\u7b7e\u662f\u4e92\u8054\u7f51 meta robots \u534f\u8bae\u7684\u5176\u4e2d\u4e4b\u4e00\uff0cGoogle \u548c Yahoo \u8fd9\u7c7b\u641c\u7d22\u5f15\u64ce\u90fd\u4f1a\u4e2d\u89c4\u4e2d\u77e9\u5730\u6309\u8fd9\u4e2a\u534f\u8bae\u6267\u884c\uff0c\u552f\u72ec\u767e\u5ea6\u4e0d\u9e1f noindex \u8fd9\u4e2a\u6807\u7b7e\uff0c\u63a5\u4e0b\u6765 BS \u767e\u5ea6\u7684\u8bdd\u6211\u5c31\u4e0d\u591a\u8bf4\u4e86\uff0c\u7559\u7ed9\u7ae5\u978b\u4eec\u5728\u8bc4\u8bba\u4e2d\u81ea\u7531\u53d1\u6325\u54af\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[201,207,313,886],"class_list":["post-1610","post","type-post","status-publish","format-standard","hentry","category-easy-setup","tag-meta","tag-noindex","tag-wordpress","tag-886"],"_links":{"self":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/1610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1610"}],"version-history":[{"count":0,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions"}],"wp:attachment":[{"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}