{"id":425,"date":"2017-08-27T11:22:05","date_gmt":"2017-08-27T03:22:05","guid":{"rendered":"https:\/\/i007.cc\/wordpress\/?p=425"},"modified":"2019-06-25T19:22:20","modified_gmt":"2019-06-25T11:22:20","slug":"%e5%ae%89%e8%a3%85%e5%ae%8c-wordpress-%e5%90%8e%e4%bd%a0%e5%ba%94%e8%af%a5%e5%81%9a%e5%a5%bd%e8%bf%9924%e4%bb%b6%e4%ba%8b","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/425","title":{"rendered":"\u5b89\u88c5\u5b8c WordPress \u540e\u4f60\u5e94\u8be5\u505a\u597d\u8fd924\u4ef6\u4e8b"},"content":{"rendered":"<div class=\"article-detail-hd\">\n<div class=\"error f-fr\">\u5728\u4f60\u5b89\u88c5\u5b8c WordPress \u540e\uff0c\u4f60\u53ef\u80fd\u4f1a\u8c03\u6574\u4e00\u4e9b\u8bbe\u5b9a\u6765\u6700\u4f73\u5316 WordPress \u6548\u80fd\u548c\u5b89\u5168\u6027\u3002\u8fd9\u91cc\u6709\u4e00\u4efd\u5b89\u88c5\u5b8c WordPress \u540e\u4f60\u5e94\u8be5\u505a\u7684\u6700\u4f73\u5316\u6307\u5357\u3002\u5b89\u88c5 WordPress \u53ea\u9700\u8981\u4e24\u4e2a\u7b80\u5355\u7684\u6b65\u9aa4\uff0c\u4f46\u4f60\u53ef\u80fd\u8981\u8c03\u6574\u4e00\u4e9b\u9884\u8bbe\u7684\u8bbe\u5b9a\u503c\uff0c\u6765\u6539\u5584\u3001\u6700\u4f73\u5316 WordPress \u7f51\u7ad9\u7684\u6548\u80fd\u548c\u589e\u5f3a\u5b89\u5168\u6027\u3002<\/div>\n<\/div>\n<div class=\"article-detail-bd\">\n<div id=\"ctrlfscont\" class=\"detail\">\n<p><strong>\u5982\u4f55\u6700\u4f73\u5316\u4f60\u7684 WordPress \u7f51\u7ad9\uff1f<\/strong><\/p>\n<p>\u8fd9\u4e9b\u5efa\u8bae\u53ea\u9488\u5bf9\u81ea\u67b6\u7684 WordPress \u7f51\u7ad9\uff0c\u4e0d\u9002\u7528\u4e8e WordPress.com\u3002\u53e6\u5916\uff0c\u6211\u5047\u8bbe\u4f60\u662f\u5728 Apache \u4e0a\u67b6\u8bbe WordPress \u7684\u3002\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\uff1a<\/p>\n<p><strong>1. \u53d8\u66f4\u9884\u8bbe\u7684\u5a92\u4f53\u4e0a\u4f20\u76ee\u5f55<\/strong><\/p>\n<p>WordPress \u9884\u8bbe\u4f1a\u5c06\u4f60\u7684\u6240\u6709\u56fe\u7247\u3001\u6587\u4ef6\u548c\u5176\u4ed6\u4e0a\u4f20\u7684\u6863\u6848\u50a8\u5b58\u4e8e wp-content\/uploads \u76ee\u5f55\u3002<\/p>\n<p>\u5c06\u4f60\u7684\u56fe\u7247\u50a8\u5b58\u4e8e WordPress \u76ee\u5f55\u4e4b\u5916\u662f\u4e2a\u4e0d\u9519\u7684\u4f5c\u6cd5\uff0c\u6700\u597d\u5728\u4e00\u4e2a\u5b50\u7f51\u57df\u5e95\u4e0b\u3002\u8fd9\u6709\u51e0\u4e2a\u4f18\u70b9\uff0c\u4f60\u7684\u56fe\u7247\u7f51\u5740\u4f1a\u66f4\u52a0\u7b80\u77ed\uff0c\u6bcf\u65e5\u7684 WordPress \u5907\u4efd\u4f1a\u66f4\u6709\u5f39\u6027\uff0c\u800c\u4e14\u6700\u91cd\u8981\u7684\u662f\uff0c\u4ece\u4e0d\u540c\u7684\u4f3a\u670d\u5668\u8f7d\u5165\u56fe\u7247\u5c06\u6709\u52a9\u4e8e\u6539\u5584\u7f51\u9875\u5f00\u555f\u901f\u5ea6\u3002<\/p>\n<p>WordPress 3.5\uff08\u6216\u66f4\u65b0\u7248\u672c\uff09\u5df2\u7ecf\u6ca1\u6709\u63d0\u4f9b\u53d8\u66f4\u9884\u8bbe\u5a92\u4f53\u4e0a\u4f20\u76ee\u5f55\u7684\u9009\u9879\uff0c\u4f46\u53ef\u4ee5\u4f7f\u7528\u5916\u6302\u6765\u5f00\u555f\u8fd9\u9879\u8bbe\u5b9a\u3002\u540c\u65f6\u53d6\u6d88\u9009\u62e9\u8be5\u9009\u9879\u2013\u201c\u5c06\u6211\u6240\u4e0a\u4f20\u7684\u6863\u6848\u5b89\u6392\u4e3a\u4ee5\u300c\u6708\u300d\u53ca\u300c\u5e74\u300d\u4e3a\u57fa\u6e96\u7684\u76ee\u5f55\u201d\u3002<\/p>\n<p><strong>2. \u4ece\u4f60\u7684 WordPress \u7f51\u7ad9\u79fb\u9664\u4e0d\u5fc5\u8981\u7684 meta-data<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u68c0\u89c6\u8fc7\u4f60\u7684 WordPress \u7f51\u7ad9\u539f\u59cb\u7801\uff0c\u4f60\u53ef\u4ee5\u53d1\u73b0\u6709\u4e9b meta \u6807\u7c64\u4e0d\u662f\u5fc5\u8981\u7684\u3002\u4f8b\u5982\uff0c\u4f60\u4f7f\u7528\u7684 WordPress \u7248\u672c\u4f1a\u663e\u793a\u4e8e\u539f\u59cb\u7801\u3002<\/p>\n<p>\u8fd9\u9879\u8d44\u8baf\u5bf9\u4e8e\u4e00\u4e9b\u5bfb\u627e\u4f7f\u7528\u65e7\u7248\u6216\u4f4e\u5b89\u5168\u6027\u7248\u672c WordPress \u7f51\u7ad9\u653b\u51fb\u7684\u9ed1\u5ba2\u6765\u8bf4\u662f\u4e2a\u4e0d\u9519\u7684\u63d0\u793a\u3002\u4ece\u4f60\u7684 WordPress \u539f\u59cb\u7801\u5b8c\u6574\u79fb\u9664\u6389\u7248\u672c\u53f7\u548c\u5176\u4ed6\u975e\u5fc5\u8981\u7684 meta-data\uff0c\u53ea\u8981\u628a\u628a\u8fd9\u6bb5\u7a0b\u5f0f\u7801\u52a0\u5165\u4f48\u666f\u4e3b\u9898\u7684 functions.php \u6863\u6848\u5373\u53ef\u3002<\/p>\n<ul>\n<li>remove_action( 1wp_head1, 1wp_generator1 ) ;<\/li>\n<\/ul>\n<ul>\n<li>remove_action( 1wp_head1, 1wlwmanifest_link1 ) ;<\/li>\n<\/ul>\n<ul>\n<li>remove_action( 1wp_head1, 1rsd_link1 ) ;<\/li>\n<\/ul>\n<p>WLW-Manifest \u51fd\u5f0f\uff08\u7b2c\u4e8c\u884c\uff09\u662f Windows Live Writer \u7528\u4e8e\u4e0b\u8f7d\u4f60 WordPress \u90e8\u843d\u683c\u7684\u6837\u5f0f\u3001\u4f48\u666f\u4e3b\u9898\u3002Windows Live Writer \u4f7f\u7528\u8005\u4e0d\u4f7f\u7528\u5373\u65f6\u9884\u89c8\u529f\u80fd\uff0c\u6545\u53ef\u4ee5\u5c06\u6b64\u51fd\u5f0f\u5173\u95ed\u3002<\/p>\n<p><strong>3. \u9632\u6b62\u4f7f\u7528\u8005\u76f4\u63a5\u700f\u89c8\u4f60\u7684 WordPress \u76ee\u5f55\u7ed3\u6784<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u4e0d\u5e0c\u671b\u4efb\u4f55\u4eba\u76f4\u63a5\u700f\u89c8\u4f60 WordPress \u6863\u6848\u548c\u8d44\u6599\u5939\u6e05\u5355\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u52a0\u5165\u4f60 WordPress \u5185\u73b0\u6709\u7684 .htaccess \u6863\u6848\u4e2d\u3002<\/p>\n<p>Options All -Indexes<\/p>\n<p>\u5e76\u786e\u8ba4 wp-content\/themes \u548c wp-content\/plugins \u76ee\u5f55\u4e0b\u5305\u542b\u7a7a\u767d\u7684 index.php \u6863\u6848\u3002<\/p>\n<p><strong>4. \u505c\u7528 WordPress \u56de\u54cd\u7684 HTML \u529f\u80fd<\/strong><\/p>\n<p>WordPress \u7684\u56de\u54cd\u7559\u8a00\u6846\u662f\u4e00\u4e2a\u5c0f\u578b\u7684 HTML \u7f16\u8f91\u5668\uff0c\u7559\u8a00\u8005\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u6807\u6e96\u7684 HTML \u8bed\u6cd5\u50cf\u662f\u00a0<strong>\u3001<a>\u3001<em>\u00a0\u6765\u4e3a\u81ea\u5df1\u7684\u7559\u8a00\u52a0\u5165\u683c\u5f0f\u3002\u4ed6\u4eec\u751a\u81f3\u80fd\u591f\u5728\u7559\u8a00\u91cc\u52a0\u5165\u8d85\u8fde\u7ed3\u3002\u5982\u679c\u4f60\u60f3\u5728 WordPress \u56de\u54cd\u91cc\u505c\u7528 HTML \u529f\u80fd\uff0c\u53ea\u8981\u628a\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165\u4f60\u7684 functions.php \u6863\u6848\u5373\u53ef\u3002<\/em><\/a><\/strong><\/p>\n<ul>\n<li>add_filter( 1pre_comment_content1, 1wp_specialchars1 )\uff1b<\/li>\n<\/ul>\n<p><strong>5. \u5173\u95ed WordPress \u6587\u7ae0\u7248\u672c\u529f\u80fd<\/strong><\/p>\n<p>WordPress \u5185\u5efa\u4e00\u4e2a\u5b9e\u7528\u7684\u6587\u7ae0\u7248\u672c\u529f\u80fd\uff0c\u8ba9\u4f60\u53ef\u4ee5\u8ffd\u8e2a\u53d8\u5316\uff0c\u4ee5\u4fbf\u968f\u65f6\u56de\u5fa9\u5230\u6587\u7ae0\u5148\u524d\u7684\u7248\u672c\u3002\u6587\u7ae0\u7248\u672c\u4e5f\u4f1a\u589e\u52a0 WordPress \u91cc wp_posts \u8d44\u6599\u8868\u7684\u5927\u5c0f\uff0c\u56e0\u4e3a\u6bcf\u6b21\u4fee\u8ba2\u90fd\u4f1a\u589e\u52a0\u65b0\u7684\u5185\u5bb9\u3002<\/p>\n<p>\u8981\u505c\u7528 WordPress \u91cc\u6587\u7ae0\u7248\u672c\u7684\u529f\u80fd\uff0c\u5f00\u555f\u4f60 WordPress \u76ee\u5f55\u4e0b\u7684 wp-config.php \u7136\u540e\u52a0\u5165\u4ee5\u4e0b\u7a0b\u5f0f\u7801\uff1a<\/p>\n<ul>\n<li>define( 1WP_POST_REVISIONS1, false)\uff1b<\/li>\n<\/ul>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u4f60\u60f3\u4fdd\u7559\u6587\u7ae0\u7248\u672c\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u53ea\u9650\u5236 WordPress \u50a8\u5b58\u4e8e MySQL \u8d44\u6599\u5e93\u91cc\u7684\u4fee\u8ba2\u6570\uff0c\u5728 wp-config.php \u52a0\u5165\u4ee5\u4e0b\u7a0b\u5f0f\u7801\uff1a\uff083 \u4e3a\u8981\u4fdd\u7559\u7684\u6587\u7ae0\u7248\u672c\u6570\u91cf\uff09<\/p>\n<ul>\n<li>define( 1WP_POST_REVISIONS1, 3)\uff1b<\/li>\n<\/ul>\n<p><strong>6. \u53d8\u66f4\u6587\u7ae0\u81ea\u52a8\u50a8\u5b58\u7684\u65f6\u95f4\u95f4\u9694<\/strong><\/p>\n<p>\u5f53\u4f60\u5728 WordPress \u5185\u5efa\u7684\u7f16\u8f91\u5668\u7f16\u8f91\u90e8\u843d\u683c\u6587\u7ae0\u65f6\uff0c\u5b83\u4f1a\u81ea\u52a8\u50a8\u5b58\u4f60\u7684\u8349\u7a3f\uff0c\u5f53\u700f\u89c8\u5668\u4e0d\u5e78\u5f53\u6389\u65f6\uff0c\u6709\u52a9\u4e8e\u4f60\u5feb\u901f\u6062\u5fa9\u5148\u524d\u8f93\u5165\u7684\u5185\u5bb9\u3002\u8349\u7a3f\u9884\u8bbe\u4f1a\u6bcf\u5206\u9418\u81ea\u52a8\u50a8\u5b58\uff0c\u4f46\u4f60\u53ef\u4ee5\u52a0\u5165\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u6765\u5c06\u81ea\u52a8\u50a8\u5b58\u7684\u65f6\u95f4\u95f4\u9694\u53d8\u66f4\u4e3a 120 \u79d2\uff08\u6216 2 \u5206\u9418\uff09\uff1a<\/p>\n<ul>\n<li>define( 1AUTOSAVE_INTERVAL1, 120 )\uff1b<\/li>\n<\/ul>\n<p><strong>7. \u9690\u85cf\u5176\u4ed6 WordPress Feeds \u7f51\u5740<\/strong><\/p>\n<p>\u4f60\u7684 WordPress \u5305\u542b\u591a\u4e2a RSS Feeds\u2013\u90e8\u843d\u683c\u3001\u6587\u7ae0\u3001\u56de\u54cd\u3001\u5206\u7c7b\u3001\u6c47\u6574\u7b49\u9875\u9762\u7686\u6709 feeds\u2013\u5b83\u4eec\u4f1a\u4f7f\u7528\u6807\u7c64\u663e\u793a\u4e8e\u4f60\u90e8\u843d\u683c\u7684\u539f\u59cb\u7801\u5185\u3002<\/p>\n<p>\u5982\u679c\u4f60\u53ea\u60f3\u5ba3\u4f20\u4f60\u7684\u4e3b\u8981 RSS Feeds\uff0c\u90a3\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165\u4f60\u7684 functions.php \u6863\u6848\u91cc\uff1a<\/p>\n<ul>\n<li>remove_action( 1wp_head1, 1feed_links1, 2 )\uff1b<\/li>\n<li>remove_action( 1wp_head1, 1feed_links_extra1, 3 )\uff1b<\/li>\n<\/ul>\n<p><strong>8. \u5c06\u6240\u6709 Feeds \u91cd\u65b0\u5bfc\u5411\u81f3\u4f60\u7684\u4e3b\u8981 RSS Feed<\/strong><\/p>\n<p>\u5728\u4e0a\u4e00\u4e2a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ea\u6709\u4ece\u7f51\u9875\u5185\u79fb\u9664\u6389\u4e0d\u5fc5\u8981\u7684 RSS Feeds\uff0c\u4f46\u8fd9\u4e9b RSS Feeds \u4f9d\u7136\u5b58\u5728\u3002\u5982\u679c\u4f60\u60f3\u8981\u5355\u72ec\u4f7f\u7528\u4e00\u4e2a RSS Feed \u4f8b\u5982 FeedBurner\uff0c\u5e76\u505c\u7528\u6240\u6709\u5176\u4ed6\u7684 Feeds\uff0c\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165\u4f60\u7684 .htaccess \u6863\u6848\u3002\u8bb0\u5f97\u628a feed URL \u66ff\u6362\u4e3a\u4f60\u81ea\u5df1\u7684\u7f51\u5740\u3002<\/p>\n<ul>\n<li>\u00a0RewriteEngine on<\/li>\n<\/ul>\n<ul>\n<li>\u00a0RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]<\/li>\n<li>\u00a0RewriteRule ^feed\/?.*$ http:\/\/feeds.freegroup.org\/freegroup [L,NC,R=301]<\/li>\n<\/ul>\n<p><strong>9. \u9690\u85cf WordPress \u767b\u5165\u753b\u9762\u7684\u9519\u8bef\u8baf\u606f<\/strong><\/p>\n<p>\u5f53\u4f60\u8f93\u5165\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u4f7f\u7528\u8005\u540d\u79f0\uff0c\u6216\u662f\u9519\u8bef\u5bc6\u7801\u6765\u767b\u5165 WordPress \u65f6\uff0c\u5b83\u4f1a\u663e\u793a\u76f8\u5f53\u8be6\u7ec6\u7684\u9519\u8bef\u8baf\u606f\uff0c\u6765\u544a\u8bc9\u4f60\u4f7f\u7528\u8005\u540d\u79f0\u9519\u8bef\uff0c\u6216\u662f\u5bc6\u7801\u9519\u8bef\uff0c\u8fd9\u662f\u72e0\u7cdf\u7cd5\u7684\u3002<\/p>\n<p>\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165 functions.php \u6863\u6848\u6765\u9690\u85cf\u6240\u6709\u767b\u5165\u76f8\u5173\u7684\u9519\u8bef\u63d0\u793a\u3002<\/p>\n<ul>\n<li>\n<pre>function no_errors_please(){ return 'GET OFF MY LAWN !! RIGHT NOW !!';}add_filter( 'login_errors', 'no_errors_please' );<\/pre>\n<\/li>\n<\/ul>\n<p><strong>10. \u542f\u7528\u4e8c\u9636\u6bb5\u9a8c\u8bc1\u529f\u80fd<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5f3a\u70c8\u5efa\u8bae\u5f00\u542f\u4e8c\u9636\u6bb5\u9a8c\u8bc1\u3002\u5982\u679c\u6709\u4eba\u53d6\u5f97\u4e86\u4f60 WordPress \u5e10\u53f7\u5bc6\u7801\uff0c\u4ed6\u4eec\u4ecd\u9700\u8981\u4f60\u7684\u624b\u673a\u624d\u80fd\u591f\u767b\u5165 WordPress \u63a7\u5236\u53f0\u3002<\/p>\n<p>\u4e0d\u50cf Dropbox \u6216 Google\uff0cWordPress \u5e76\u6ca1\u6709\u5185\u5efa\u4e8c\u9636\u6bb5\u9a8c\u8bc1\u529f\u80fd\uff0c\u4f46\u4f60\u53ef\u4ee5\u4f7f\u7528\u5916\u6302\u6765\u5c06\u5b83\u52a0\u5165\u3002Authy \u662f\u76f8\u5f53\u53d7\u6b22\u8fce\u7684\u4e8c\u9636\u6bb5\u9a8c\u8bc1\u5916\u6302\uff0c\u867d\u7136\u6211\u559c\u6b22\u7684\u662f Authenticator\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u642d\u914d Google \u5b98\u65b9\u7684 Authenticator \u5e94\u7528\u7a0b\u5f0f\u4f7f\u7528\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>11. \u53d8\u66f4\u56fa\u5b9a\u7f51\u5740\u7ed3\u6784<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0d\u8981\u4f7f\u7528 WordPress \u9884\u8bbe\u7684\u56fa\u5b9a\u7f51\u5740\u7ed3\u6784\uff0c\u56e0\u4e3a\u8fd9\u4e0d\u5229\u4e8e SEO\u3002<\/p>\n<p>\u524d\u5f80 WordPress \u63a7\u5236\u53f0\u7684\u8bbe\u5b9a -&gt; \u56fa\u5b9a\u7f51\u5740\u6765\u53d8\u66f4\u4f60\u7684 WordPress \u56fa\u5b9a\u7f51\u5740\u7ed3\u6784\u3002\u4ece\u641c\u5bfb\u5f15\u64ce\u6700\u4f73\u5316\u53ca\u6548\u80fd\u6765\u770b\uff0c\u5efa\u8bae\u4f7f\u7528\u7684\u7ed3\u6784\u4e3a\uff1a<\/p>\n<ul>\n<li>\/%post_id%\/%postname%<\/li>\n<\/ul>\n<ul>\n<li><\/li>\n<li><strong>12. \u52a0\u5165\u9057\u5931\u7684 favicon \u53ca touch icons<\/strong>\u4f60\u7684 WordPress \u4f48\u666f\u4e3b\u9898\u53ef\u80fd\u6ca1\u6709\u5305\u542b\u7f51\u7ad9\u56fe\u793a\uff08favicon.ico\uff09\u6216 Apple touch icons\uff0c\u4f46\u7f51\u9875\u700f\u89c8\u5668\u548c RSS \u9605\u8bfb\u5668\u4ecd\u7136\u53ef\u80fd\u5411\u4f60\u7684\u4f3a\u670d\u5668\u8981\u6c42\u8fd9\u4e9b\u6863\u6848\u3002\u6700\u597d\u7684\u529e\u6cd5\u662f\u63d0\u4f9b\u8fd9\u4e9b\u6863\u6848\uff0c\u800c\u4e0d\u662f\u56de\u4f20 404 \u9519\u8bef\u3002\u5728\u4f60\u7684\u7f51\u7ad9\u6839\u76ee\u5f55\u653e\u7f6e\u4e00\u4e2a 16\u00d716 \u7684 favicon.ico \u548c 144\u00d7144 \u7684 apple-touch.png \u6863\u6848\u3002\u7136\u540e\u5728\u4f60\u7684 .htaccess \u52a0\u5165\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u6765\u91cd\u65b0\u6863\u5411\u6240\u6709 Apple touch icon \u7684\u8bf7\u6c42\u81f3\u7279\u5b9a\u6863\u6848\u3002\n<ul>\n<li>RedirectMatch 301 \/apple-touch-icon(.*)?.png http:\/\/upload.chinaz.com\/\/<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>13. \u7981\u6b62\u7d22\u5f15 WordPress \u7a0b\u5f0f<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u4f60\u5e0c\u671b Google \u548c\u5176\u4ed6\u641c\u5bfb\u5f15\u64ce\u53ef\u4ee5\u6293\u53d6\u4f60\u7684\u90e8\u843d\u683c\u6587\u7ae0\uff0c\u4f46\u4e0d\u4f1a\u5e0c\u671b\u7d22\u5f15\u4f60\u7528\u4e8e WordPress\u3001\u5916\u6302\u548c\u4f48\u666f\u4e3b\u9898\u7684\u7a0b\u5f0f\u3002<\/p>\n<p>\u5f00\u555f\u4f60 WordPress \u4e3b\u76ee\u5f55\u5e95\u4e0b\u7684 robots.txt \u5e76\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff0c\u6765\u963b\u6b62\u641c\u5bfb\u5f15\u64ce\u7d22\u5f15 WordPress \u540e\u53f0\u7684\u5143\u4ef6\u3002<\/p>\n<ul>\n<li>User-agent: *<\/li>\n<\/ul>\n<ul>\n<li>Disallow: \/wp-admin\/<\/li>\n<li>Disallow: \/wp-includes\/<\/li>\n<li>Disallow: \/wp-content\/plugins\/<\/li>\n<li>Disallow: \/wp-content\/themes\/<\/li>\n<li>Disallow: \/feed\/<\/li>\n<\/ul>\n<ul>\n<li>Disallow: *\/feed\/<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>14. \u628a Admin \u6743\u9650\u8bbe\u4e3a\u8bfb\u8005<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u4f60\u7684 WordPress \u5e10\u53f7\u662f\u201dadmin\u201d\uff0c\u5efa\u7acb\u4e00\u4e2a\u65b0\u7684\u4f7f\u7528\u8005\u540d\u79f0\u5e76\u7ed9\u4ed6\u7cfb\u7edf\u7ba1\u7406\u5458\u6743\u9650\u3002\u63a5\u8457\u767b\u51fa WordPress\uff0c\u4ee5\u65b0\u7684\u5e10\u53f7\u767b\u5165\uff0c\u5c06 \u201cadmin\u201d \u6743\u9650\u4ece\u7cfb\u7edf\u7ba1\u7406\u5458\u8bbe\u5b9a\u4e3a\u8bfb\u8005\u3002<\/p>\n<p>\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u8003\u8651\u628a\u5e10\u53f7 \u201cadmin\u201d \u5220\u9664\uff0c\u7136\u540e\u5c06\u73b0\u6709\u7684\u4efb\u4f55\u6587\u7ae0\u3001\u9875\u9762\u8f6c\u79fb\u7ed9\u65b0\u5e10\u53f7\u3002\u8fd9\u5bf9\u4e8e\u5b89\u5168\u6027\u6765\u8bf4\u662f\u76f8\u5f53\u91cd\u8981\u7684\u4e00\u4e2a\u6b65\u9aa4\uff0c\u56e0\u4e3a\u6211\u4eec\u4e0d\u5e0c\u671b\u8ba9\u4efb\u4f55\u4eba\u6709\u673a\u4f1a\u731c\u6d4b\u5177\u6709 WordPress \u7ba1\u7406\u5458\u6743\u9650\u7684\u4f7f\u7528\u8005\u540d\u79f0\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>15. \u5bf9\u641c\u5bfb\u5f15\u64ce\u9690\u85cf\u4f60\u7684 XML Sitemaps<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>XML Sitemaps \u53ef\u4ee5\u5e2e\u52a9\u641c\u5bfb\u5f15\u64ce\u66f4\u597d\u5730\u6293\u53d6\u4f60\u7684\u7f51\u7ad9\u5185\u5bb9\uff0c\u4f46\u4f60\u4e0d\u4f1a\u5e0c\u671b\u641c\u5bfb\u5f15\u64ce\u5728\u641c\u5bfb\u7ed3\u679c\u9875\u9762\u663e\u793a\u4f60\u7684\u7f51\u7ad9\u5730\u56fe\u3002<\/p>\n<p>\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165\u4f60\u7684 .htaccess \u6765\u9632\u6b62 XML Sitemals \u88ab\u641c\u5bfb\u5f15\u64ce\u7d22\u5f15\uff1a<\/p>\n<ul>\n<li><\/li>\n<\/ul>\n<ul>\n<li><\/li>\n<li>Header set X-Robots-Tag &#8220;noindex&#8221;<\/li>\n<li><\/li>\n<\/ul>\n<ul>\n<li><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>16. \u4e0d\u8981\u4f7f\u7528 WordPress \u5185\u5efa\u7684\u641c\u5bfb\u529f\u80fd<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u786e\u8ba4\u4f60\u7684\u7f51\u7ad9\u641c\u5bfb\u529f\u80fd\u662f\u7531 Google \u81ea\u8ba2\u641c\u5bfb\u6240\u63d0\u4f9b\uff0c\u4e0d\u8981\u4f7f\u7528 WordPress \u5185\u5efa\u7684\u641c\u5bfb\u529f\u80fd\u3002<\/p>\n<p>WordPress \u641c\u5bfb\u901a\u5e38\u4f1a\u4f20\u56de\u4e0d\u76f8\u5173\u7684\u7ed3\u679c\uff0c\u53e6\u4e00\u4e2a\u597d\u5904\u662f\u8fd9\u9ebc\u505a\u80fd\u964d\u4f4e\u4f60\u7684 WordPress \u4f3a\u670d\u5668\u3001\u8d44\u6599\u5e93\u8d1f\u8f7d\uff0c\u56e0\u4e3a\u641c\u5bfb\u67e5\u8be2\u5c06\u900f\u8fc7 Google \u6765\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u4f60\u6253\u7b97\u7ee7\u7eed\u4f7f\u7528 WordPress \u5185\u5efa\u7684\u641c\u5bfb\u529f\u80fd\uff0c\u90a3\u5c31\u4f7f\u7528 Nice Search \u5916\u6302\u5427\uff01\u5b83\u80fd\u4e3a\u4f60\u7684 WordPress \u641c\u5bfb\u9875\u9762\u5efa\u7acb\u66f4\u597d\u7684\u56fa\u5b9a\u7f51\u5740\uff08\/search\/tutorials vs \/s?tutorials\uff09\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>17. \u4ee5\u5bc6\u7801\u4fdd\u62a4\u4f60\u7684 wp-admin \u76ee\u5f55<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u4f60\u53ef\u4ee5\u7b80\u5355\u5730\u4e3a WordPress \u589e\u52a0\u989d\u5916\u7684\u5b89\u5168\u9632\u62a4\uff0c\u4f8b\u5982\u4ee5\u5bc6\u7801\u6765\u4fdd\u62a4 wp-admin \u76ee\u5f55\u3002\u4f60\u5fc5\u987b\u8981\u8bb0\u4f4f\u4e24\u7ec4\u5bc6\u7801\u624d\u80fd\u591f\u767b\u5165\u81f3 WordPress \u2013 \u5305\u62ec\u4f60\u7684 WordPress \u5bc6\u7801\uff0c\u4ee5\u53ca\u4fdd\u62a4 wp-admin \u76ee\u5f55\u7684\u5bc6\u7801\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>18. \u5728 Google \u5206\u6790\u8bb0\u5f55 404 \u9519\u8bef<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>404 \u9519\u8bef\u4f1a\u9519\u5931\u4f7f\u7528\u8005\u8fdb\u5165\u7f51\u7ad9\u7684\u673a\u4f1a\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 Google \u5206\u6790\u6765\u8bb0\u5f55\u4f60\u7684 404 \u9519\u8bef\uff0c\u5305\u542b\u4ece\u4f55\u800c\u6765\u7b49\u7ec6\u8282\u8d44\u6599\u3002<\/p>\n<p>\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165\u4f60\u7684 Google \u5206\u6790\u8ffd\u8e2a\u4ee3\u7801\uff0c\u4e8e _gaq.push \u51fd\u5f0f\u4e4b\u540e\uff1a<\/p>\n<ul>\n<li>&lt;? if (is_404()) { ?&gt;<\/li>\n<\/ul>\n<ul>\n<li>_gaq.push([1_trackEvent1, 14041, document.location.pathname + document.location.search, document.referrer, 0, true])2<\/li>\n<\/ul>\n<ul>\n<li>&lt;? }<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>19. \u5220\u9664\u6240\u6709\u6ca1\u7528\u5230\u7684\u4f48\u666f\u4e3b\u9898\u548c WordPress \u5916\u6302<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u672a\u4f7f\u7528\u7684\u5916\u6302\u548c\u4f48\u666f\u4e3b\u9898\u4e0d\u4f1a\u5f71\u54cd\u4f60\u7684 WordPress \u7f51\u7ad9\u6548\u80fd\uff0c\u4f46\u6211\u4eec\u7684\u76ee\u6807\u662f\u5c3d\u53ef\u80fd\u51cf\u5c11\u4f3a\u670d\u5668\u4e0a\u53ef\u6267\u884c\u7684\u7a0b\u5f0f\u7801\u3002\u505c\u7528\u5e76\u5220\u9664\u6240\u6709\u4f60\u4e0d\u9700\u8981\u7684\u4e1c\u897f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>20. \u505c\u6b62 WordPress \u731c\u6d4b\u7f51\u5740\u529f\u80fd<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>WordPress \u6709\u4e00\u4e2a\u4f1a\u731c\u6d4b\u7f51\u5740\u7684\u5947\u602a\u529f\u80fd\uff0c\u4e14\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u4f1a\u9020\u6210\u9519\u8bef\u3002\u8ba9\u6211\u89e3\u91ca\u4e00\u4e0b\uff0c\u5982\u679c\u4e00\u4f4d\u8bbf\u5ba2\u8981\u5b58\u53d6 freegroup.org\/hello \u7f51\u5740\uff0c\u4f46\u8fd9\u4e2a\u9875\u9762\u5e76\u4e0d\u5b58\u5728\uff0cWordPress \u53ef\u80fd\u4f1a\u628a\u4f7f\u7528\u8005\u91cd\u65b0\u5bfc\u5411\u81f3 freegroup.org\/hello-world \u53ea\u56e0\u4e3a\u8fd9\u7f51\u5740\u6709\u4e00\u4e9b\u5e38\u7528\u8bcd\u6c47\u3002<\/p>\n<p>\u5982\u679c\u4f60\u5e0c\u671b WordPress \u505c\u6b62\u731c\u6d4b\u7f51\u5740\uff0c\u5e76\u4ee5 404 \u627e\u4e0d\u5230\u7f51\u9875\u7684\u9519\u8bef\u8baf\u606f\u6765\u53d6\u4ee3\uff0c\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165 functions.php\uff1a<\/p>\n<ul>\n<li>add_filter(1redirect_canonical1, 1stop_guessing1)2<\/li>\n<\/ul>\n<ul>\n<li>function stop_guessing($url) {<\/li>\n<li>if (is_404()) {<\/li>\n<li>return false2<\/li>\n<li>}<\/li>\n<li>return $url2<\/li>\n<\/ul>\n<ul>\n<li>}<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>21. \u4e3a\u9759\u6001\u5185\u5bb9\u8bbe\u5b9a\u8fc7\u671f\u65f6\u95f4<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u50a8\u5b58\u4e8e\u4f60 WordPress \u7f51\u7ad9\u7684\u9759\u6001\u5185\u5bb9\uff1a\u50cf\u662f\u56fe\u7247\u3001CSS\u3001JavaScript\u3001.txt \u7b49\u7b49\u4e0d\u4f1a\u7ecf\u5e38\u6539\u53d8\uff0c\u4f60\u53ef\u4ee5\u8bbe\u5b9a\u8fc7\u671f\u65f6\u95f4\u8ba9\u5b83\u4eec\u5feb\u53d6\u4e8e\u4f7f\u7528\u8005\u7684\u6d4f\u89c8\u5668\u4e2d\u3002\u56e0\u6b64\uff0c\u5728\u7a0d\u540e\u8bbf\u95ee\u7f51\u7ad9\u7684\u8fc7\u7a0b\u91cc\uff0c\u4f60\u7684\u7f51\u7ad9\u5c31\u80fd\u66f4\u5feb\u8f7d\u5165 JS \u548c CSS \uff0c\u56e0\u4e3a\u662f\u4ece\u672c\u673a\u7684\u5feb\u53d6\u4e2d\u88ab\u8f7d\u5165\u3002<\/p>\n<p>\u8bf7\u53c2\u9605 HTML5 \u6a21\u7248\u7684 .htaccess \u6863\u6848\uff0c\u6765\u4e86\u89e3\u8bbe\u5b9a\u8fc7\u671f\u65f6\u95f4\u7684\u7ec6\u8282\u3002\u5982\u679c\u4f60\u662f\u4f7f\u7528\u50cf\u662f W3 Total Cache \u4e4b\u7c7b\u7684\u5feb\u53d6\u5916\u6302\uff0c\u5feb\u53d6\u63a7\u5236\u672c\u8eab\u662f\u7531\u5916\u6302\u6765\u505a\u7ba1\u7406\u3002<\/p>\n<ul>\n<li>ExpiresActive On<\/li>\n<\/ul>\n<ul>\n<li>ExpiresByType image\/gif &#8220;access plus 30 days&#8221;<\/li>\n<li>ExpiresByType image\/jpeg &#8220;access plus 30 days&#8221;<\/li>\n<li>ExpiresByType image\/png &#8220;access plus 30 days&#8221;<\/li>\n<li>ExpiresByType text\/css &#8220;access plus 1 week&#8221;<\/li>\n<\/ul>\n<ul>\n<li>ExpiresByType text\/javascript &#8220;access plus 1 week&#8221;<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>22. \u5f3a\u5316\u4f60\u7684 WordPress \u90e8\u843d\u683c\u5b89\u5168\u6027<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u6211\u5728\u65e9\u5148\u5df2\u7ecf\u8be6\u7ec6\u8ba8\u8bba\u8fc7 WordPress \u5b89\u5168\u6027\u3002\u5927\u610f\u662f\u4f60\u5e94\u8be5\u628a\u5bc6\u94a5\u52a0\u5165\u4f60\u7684 wp-config.php \u6863\u6848\uff0c\u5b89\u88c5\u6863\u6848\u76d1\u63a7\u5916\u6302\uff0c\u7136\u540e\u4f7f\u7528 Limit Login \u6765\u9632\u6b62\u66b4\u529b\u5bc6\u7801\u653b\u51fb\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>23. \u505c\u7528 WordPress \u5185\u7684\u6863\u6848\u7f16\u8f91\u529f\u80fd<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5f53\u4f60\u4ee5\u7cfb\u7edf\u7ba1\u7406\u5458\u6743\u9650\u767b\u5165\u4f60\u7684 WordPress \u63a7\u5236\u53f0\uff0c\u4f60\u53ef\u4ee5\u8f7b\u9b06\u5730\u7f16\u8f91\u4efb\u4f55 WordPress \u5916\u6302\u53ca\u4f48\u666f\u4e3b\u9898\u3002\u5982\u679c\u4f60\u60f3\u5220\u9664\u6587\u4ef6\u7684\u7f16\u8f91\u529f\u80fd\uff08\u4e00\u4e2a\u7f3a\u5c11\u7684\u5206\u53f7\u53ef\u80fd\u8ba9\u4f60\u7684 WordPress \u7f51\u7ad9\u6302\u6389\uff09\uff0c\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165 wp-config.php \u6863\u6848\u4e2d\uff1a<\/p>\n<ul>\n<li>define( &#8216;DISALLOW_FILE_EDIT&#8217;, true );<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>24. \u4ece\u7f51\u5740\u4e2d\u79fb\u9664\u591a\u9918\u7684\u67e5\u8be2\u53c2\u6570<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u4f60\u7684 WordPress \u7f51\u7ad9\u7f51\u5740\u662f abc.com\uff0c\u5982\u679c\u4f7f\u7528\u8005\u5728\u7f51\u5740\u52a0\u5165\u4e00\u4e9b\u67e5\u8be2\u53c2\u6570\uff0c\u4ecd\u7136\u53ef\u4ee5\u5230\u8fbe\u4f60\u7684\u7f51\u7ad9\u3002\u4f8b\u5982\uff0cabc.com\/?utm=ga \u6216 abc.com\/?ref=feedly \u5c31\u662f\uff0c\u4ece\u6280\u672f\u4e0a\u6765\u8bf4\uff0c\u5b8c\u5168\u4e0d\u540c\u7684\u7f51\u5740\u4e5f\u53ef\u4ee5\u8fdb\u5165\u76f8\u540c\u7684\u9875\u9762\u3002<\/p>\n<p>\u4f46\u5bf9\u4e8e\u94fe\u7ed3\u6743\u91cd\uff08SEO\uff09\u6765\u8bf4\u662f\u4e0d\u597d\u7684\uff0c\u5728\u7406\u60f3\u7684\u60c5\u51b5\u4e0b\uff0c\u4f60\u5e94\u8be5\u8ba9\u6240\u6709\u7f51\u5740\u6307\u5411\u540c\u4e00\u4e2a Canonical URL\u3002\u5c06\u4ee5\u4e0b\u7a0b\u5f0f\u7801\u52a0\u5165 .htaccess \u6765\u79fb\u9664\u6389\u4e0d\u5fc5\u8981\u7684\u67e5\u8be2\u53c2\u6570\uff1a<\/p>\n<div><\/div>\n<ul>\n<li><\/li>\n<li>\u00a0RewriteEngine On<\/li>\n<li>\u00a0RewriteCond %{QUERY_STRING} !=&#8221;&#8221;<\/li>\n<li>\u00a0RewriteCond %{QUERY_STRING} !^p=.*<\/li>\n<li>\u00a0RewriteCond %{QUERY_STRING} !^s=.*<\/li>\n<li>\u00a0RewriteCond %{REQUEST_URI} !^\/wp-admin.*<\/li>\n<li>\u00a0RewriteRule ^(.*)$ \/$1? [R=301,L]<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f60\u5b89\u88c5\u5b8c WordPress \u540e\uff0c\u4f60\u53ef<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[24],"tags":[121],"class_list":["post-425","post","type-post","status-publish","format-standard","hentry","category-value_docs","tag-05-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=425"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/425\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}