{"id":803,"date":"2013-01-15T14:50:37","date_gmt":"2013-01-15T06:50:37","guid":{"rendered":"https:\/\/sdeno.com\/?p=803"},"modified":"2013-01-15T14:52:58","modified_gmt":"2013-01-15T06:52:58","slug":"wordpress%e7%bd%91%e7%ab%99%e6%a0%87%e9%a2%98seo%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=803","title":{"rendered":"wordpress\u7f51\u7ad9\u6807\u9898seo\u4f18\u5316"},"content":{"rendered":"<p>All in One SEO Pack\u63d2\u4ef6\u5176\u5b9e\u5c31\u662f\u7528\u51e0\u884c\u4ee3\u7801\u5b9e\u884c\u5373\u53ef\u5982\u4e0b\uff1a<br \/>\n<span style=\"color: #ff0000;\">1\uff0c\u6807\u9898\uff08Title\uff09<\/span><br \/>\n\u5728\u4e3b\u9898\u7684 head.php \u4e2d\u4fee\u6539 Title \u6807\u7b7e\u4e3a\uff1a<br \/>\n[code]&lt;title&gt;<br \/>\n&lt;?php if ( is_home() ) { ?&gt;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if ( is_search() ) { ?&gt;Search Results&amp;nbsp;|&amp;nbsp;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if ( is_author() ) { ?&gt;Author Archives&amp;nbsp;|&amp;nbsp;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if ( is_single() ) { ?&gt;&lt;?php wp_title(&#8221;); ?&gt;&amp;nbsp;|&amp;nbsp;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if ( is_page() ) { ?&gt;&lt;?php wp_title(&#8221;); ?&gt;&amp;nbsp;|&amp;nbsp;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if ( is_category() ) { ?&gt;&lt;?php single_cat_title(); ?&gt;&amp;nbsp;|&amp;nbsp;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if ( is_month() ) { ?&gt;&lt;?php the_time(&#8216;F&#8217;); ?&gt;&amp;nbsp;|&amp;nbsp;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&lt;?php } ?&gt;<br \/>\n&lt;?php if (function_exists(&#8216;is_tag&#8217;)) { if ( is_tag() ) { ?&gt;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&amp;nbsp;|&amp;nbsp;Tag Archive&amp;nbsp;|&amp;nbsp;&lt;?php single_tag_title(&#8220;&#8221;, true); } } ?&gt;<br \/>\n&lt;\/title&gt;[\/code]<br \/>\n<span style=\"color: #ff0000;\">2\uff0c\u63cf\u8ff0\uff08Description\uff09<\/span><br \/>\nDescription \u5728SEO\u4e2d\u662f\u5f88\u91cd\u8981\u7684\u5143\u7d20\uff0c\u4e0b\u9762\u4e00\u6bb5\u4ee3\u7801\uff0c\u628a\u6458\u8981\u8bbe\u7f6e\u6210 \u6587\u7ae0\u9875\u9762\u7684Description, \u5206\u7c7b\u63cf\u8ff0\u8bbe\u7f6e\u6210\u5206\u7c7b\u9875\u9762\u7684Description<\/p>\n<p>[code]&lt;?php<br \/>\n\/\/if single post then add excerpt as meta description<br \/>\nif (is_single()) {<br \/>\n?&gt;<br \/>\n&lt;meta name=&#8221;Description&#8221; content=&#8221;&lt;?php echo strip_tags(get_the_excerpt($post-&gt;ID)); ?&gt;&#8221; \/&gt;<br \/>\n&lt;?php<br \/>\n\/\/if homepage use standard meta description<br \/>\n} else if(is_home() || is_page()) {<br \/>\n?&gt;<br \/>\n&lt;meta name=&#8221;Description&#8221; content=&#8221;\u8fd9\u91cc\u586b\u5199\u7f51\u7ad9\u9996\u9875\u7684\u63cf\u8ff0\uff01\uff01\uff01&#8221;&gt;<br \/>\n&lt;?php<br \/>\n\/\/if category page, use category description as meta description<br \/>\n} else if(is_category()) {<br \/>\n?&gt;<br \/>\n&lt;meta name=&#8221;Description&#8221; content=&#8221;&lt;?php echo strip_tags(category_description(get_category_by_slug(strtolower(get_the_category()))-&gt;term_id)); ?&gt;&#8221; \/&gt;<br \/>\n&lt;?php } ?&gt;[\/code]<br \/>\n\u5c06\u4ee3\u7801\u91cc\u9996\u9875\u7684\u63cf\u8ff0\u8865\u5145\u5b8c\u6574\uff0c\u7136\u540e\u53bb\u5206\u7c7b\u9875\u9762\u586b\u597d\u5206\u7c7b\u63cf\u8ff0\uff0c\u5199\u6587\u7ae0\u7684\u65f6\u5019\u5199\u597d\u6458\u8981\u3002<\/p>\n<p><span style=\"color: #ff0000;\">3\uff0c\u5173\u4e8e\u5b58\u6863\u9875\u3001\u4f5c\u8005\u9875\u3001\u6807\u7b7e\u548c\u5206\u7c7b\u9875\u7684\u201cnoindex\u201d\u5143\u6807\u8bb0<\/span><br \/>\n\u5728 header.php \u91cc\u63d2\u5165\uff1a<br \/>\n[code]&lt;?php if ( !(is_home()) &amp;&amp; !(is_single()) ) { ?&gt;&lt;meta name=&#8221;robots&#8221; content=&#8221;noindex,follow&#8221; \/&gt;&lt;?php }?&gt;[\/code]<br \/>\n\u610f\u601d\u662f\u9664\u4e86\u9996\u9875\u548c\u6587\u7ae0\uff0c\u5176\u5b83\u9875\u9762\u7981\u6b62\u641c\u7d22\u5f15\u64ce index<\/p>\n<p><span style=\"color: #ff0000;\">4\uff0c\u5173\u4e8e canonical\u6807\u8bb0<\/span><br \/>\n\u5728 header.php \u91cc\u63d2\u5165\uff1a<br \/>\n[code]&lt;?php if ( is_singular() ) { ?&gt; &lt;link rel=&#8221;canonical&#8221; href=&#8221;&lt;?php the_permalink(); ?&gt;&#8221; \/&gt; &lt;?php } ?&gt;[\/code]<br \/>\n\u6ce8\u610f\uff1a\u6240\u6709\u4ee5\u4e0a\u7684\u4ee3\u7801\uff0c\u90fd\u8981\u5728&lt;\/head&gt;\u95ed\u5408\u6807\u7b7e\u4e4b\u524d\uff01<\/p>\n<p>&nbsp;<\/p>\n<div>\u6587\u7ae0\u6765\u6e90\uff1a\u4e2a\u4eba\u968f\u7b14 \u9999\u683c\u91cc\u62c9seo (<a href=\"https:\/\/sdeno.com\">www.xgllseo.com<\/a>)\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff0c\u8bf7\u5c0a\u91cd\u7248\u6743\u3002<\/div>\n","protected":false},"excerpt":{"rendered":"<p>All in One SEO Pack\u63d2\u4ef6\u5176\u5b9e\u5c31\u662f\u7528\u51e0\u884c\u4ee3\u7801\u5b9e\u884c\u5373\u53ef\u5982\u4e0b\uff1a 1\uff0c\u6807\u9898\uff08Title\uff09 \u5728\u4e3b\u9898\u7684  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,1,11],"tags":[],"class_list":["post-803","post","type-post","status-publish","format-standard","hentry","category-seo","category-wordpress","category-11"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=803"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/803\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}