{"id":3262,"date":"2013-01-17T17:15:21","date_gmt":"2013-01-17T22:15:21","guid":{"rendered":"http:\/\/ahmeddirie.com\/?p=3262"},"modified":"2013-01-18T17:15:05","modified_gmt":"2013-01-18T22:15:05","slug":"seo-showdown-block-robots-from-indexing-wordpress-category-and-tag-pages","status":"publish","type":"post","link":"https:\/\/ahmeddirie.com\/blog\/web-development\/seo-showdown-block-robots-from-indexing-wordpress-category-and-tag-pages\/","title":{"rendered":"SEO Showdown: Block Robots from indexing WordPress Category and Tag Pages"},"content":{"rendered":"<p>I came across this issue earlier today and it has to do with the way robots from search engines like Google (who uses anything else?) work with WordPress. This post is really a mix between search engine optimization as well as the inner workings of WordPress. We&#8217;ll dive right in to outline a problem and of course, a solution.<\/p>\n<p><!--more--><\/p>\n<p>Say you&#8217;re like me and you blog about various topics like networking and web development. Chances are, you&#8217;ll categorize your content for better organization. So, with WordPress, you&#8217;ll now have a two separate URLs for your fresh new categories. These are called Category Pages and will generally list all of your blog posts within that respective category.<\/p>\n<p><strong>yourdomain.com\/blog\/category\/networking<br \/>\nyourdomain.com\/blog\/category\/web-development<\/strong><\/p>\n<p>You&#8217;ve continued blogging and along the way began tagging certain blog posts with keywords. Here&#8217;s an example; in one blog post under the web development category, you brushed up a little bit on networking and you decided to add a networking tag to that post. WordPress will in turn create another page for this tag. They&#8217;re called Tag Pages and will list the posts that have this tag.<\/p>\n<p><strong>yourdomain.com\/blog\/tag\/networking<\/strong><\/p>\n<p>Later in the future, you&#8217;ve published what might be the highlight of your blogging life and create the ultimate 101 on all things Networking. Of course, you&#8217;ll call this blog post simply, &#8220;Networking&#8221; and you file it under the networking category. Depending on how your Permalinks are set up, WordPress will either create a page with the date of that post along with its title, or if you&#8217;re like me, the post&#8217;s title will fall under the category of that post.<\/p>\n<p><strong>yourdomain.com\/blog\/2013\/01\/17\/networking<br \/>\nyourdomain.com\/blog\/networking\/networking<\/strong><\/p>\n<p>I&#8217;m not sure if you noticed, but that second link doesn&#8217;t look pretty at all.<\/p>\n<p>After a discussion with SEO and SEM expert <a href=\"http:\/\/twitter.com\/cbubinas\">Chris Bubinas<\/a>, he explained where things can get a little confusing. You&#8217;ll have three separate URLs that reference networking, fighting for dominance on Google&#8217;s search results on the topic of networking. So, what content is important? What should Google&#8217;s crawlers index? <\/p>\n<p>Chris brought up another interesting point. What if you&#8217;re a company and you want your keywords to funnel traffic back to your domain and not have your corporate site battle it out with your blog on Google? In this scenario, your company&#8217;s keyword page should have precedence over the keyword pages on your blog.<\/p>\n<p><strong>yourdomain.com\/networking<br \/>\nyourdomain.com\/blog\/category\/networking<br \/>\nyourdomain.com\/blog\/tag\/networking<\/strong><\/p>\n<p>The quick and dirty here is to block your category and tag pages from being indexed but still followed. Add the following lines of code to your header.php file in your theme folder.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php  if (is_category() || is_tag()) { ?&gt;\r\n&lt;meta name=&quot;robots&quot; content=&quot;noindex,follow&quot; \/&gt;\r\n&lt;?php } ?&gt;\r\n<\/pre>\n<p>With this, Google&#8217;s robots will not index these types of pages but will follow the links to the content in them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build a better content strategy. Understand the connection between Google robots, search engine optimization and the inner workings of Wordpress.<\/p>\n","protected":false},"author":2,"featured_media":3265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[13,169,168,393],"_links":{"self":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts\/3262"}],"collection":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/comments?post=3262"}],"version-history":[{"count":24,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts\/3262\/revisions"}],"predecessor-version":[{"id":3335,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts\/3262\/revisions\/3335"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/media\/3265"}],"wp:attachment":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/media?parent=3262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/categories?post=3262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/tags?post=3262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}