Prevent Duplicate Content on Comment PagingWorkaround for WordPress 2.7

  • wp-27-duplicate-content-pin-up

    Most search engines strive for a certain level of variety; they want to show you ten different results on a search results page, not ten different URLs that all have the same content.

    Susan Moskwa, Google Webmaster Trends Analyst

    The up-coming WordPress 2.7 introduce new advanced comment features; comment threading, nesting, paging (pagination) etc. You probably won’t have any issue with WordPress 2.7 as most of the new advanced/enhanced features is disabled by default. Thats a good news.

    Unfortunately for those enthusiastic user (like me) who wish to use the Comment paging, there is one caveat; multiple similar content. The below screenshot is taken from Google webmaster diagnostic tools for duplicate content.

    Google Webmaster tools Content analysis Comment paging duplicate content

    If you have Google Webmaster account, check out the diagnostic Content analysis tools. There is high potential that your blog will generate duplicate content (if the comment paging feature is enabled).

    How to prevent duplicate content

    Reducing duplicate content in your website is a good SEO practice. I made a small filter script for WordPress 2.7. The script ↓ will append robots noindex meta tag rules on comment page section. This methods will prevent search engine indexer and services from indexing your blog’s comment page.

    noIndex meta view code

    Installation: copy paste the below code ↓ in your theme’s functions.php

    /**
     * void wpi_comment_paging_noindex_meta()
     * Add meta noindex rules on Singular comment page section
     *
     * @author	Avice D <ck+filter@kaizeku.com>
     * @license	http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
     * @link 	http://blog.kaizeku.com/wordpress/prevent-wordpress-27-duplicate-content/
     *
     * @todo	Check for duplicate meta-robots tag generated by
     *		meta-tag type plugins (SEO plugins)
     *
     * @uses	$wp_query	Wp_query object
     * @return 	string 		Output HTML meta noindex
     */
    function wpi_comment_paging_noindex_meta()
    {	global $wp_query;
    
    	if (version_compare( (float) get_bloginfo('version'), 2.7, '>=') ){
    
    		if ($wp_query->is_singular && get_option('page_comments')){ // comments paging enabled
    			if (isset($wp_query->query['cpage'])
    				&& absint($wp_query->query['cpage']) >= 1 ){
    
    				echo '<meta name="robots" content="noindex" />'.PHP_EOL;
    			}
    		}
    	}
    }
    
    add_action('wp_head','wpi_comment_paging_noindex_meta');

    Download: noindex on comment page 573 hits

    Why duplicate content is bad for your blog?

    • Having multiple search crawler indexing the same content on your website (over and over) is an absolute bandwidth waster.
    • Bad PR. This are quite debatable to the point of myth, some search engine penalize website for duplicate content but according to Google webmaster team “If the duplicate content is not done to game (deceive) the search results there is no penalty”. Just pretend all major search engine service does have penalty rules for duplicate content issues. From my past experiences there is no telling or earlier notice “they’ll just drop you, so can you spent sometimes to figure out the why later” .
    • Bad SERP, rationally the main articles that you post should have more weight than the rest of the comment page or sub page, you don’t want to see your archives or comment page on Search Engine results while your main articles is no where to be found.

    Plug-it

    I don’t have any intention of making any WP plugin out of this simple function as this issues will probably be address and solve by WP’s developer or someone else up there. This code is release under open-source license, do whatever you want with it.

    Might be interest

    Back to top ↑

    About the Author
     

23 Responsesto “Prevent Duplicate Content on Comment Paging”

      • Avice's photo
      • Replying to malcolm coles · (#15787)
        9 months, 3 weeks ago on at 7:09 am3url · microId

        I would agree about `Comment’s “might have some useful content in them”` but I would rather leave that to the audiences. Its all depends on context.

        Anyway having the no index meta-tag wont stop bots from crawling the page. The “no index” meta rules just exclude the URLs from the search results. Otherwise the “robots.txt” rules does the job at blocking the bots from visiting the page completely (assume that all bots are being nice). Some example http://wp.istalker.net/robots.txt

        You’ll get multiple duplicate content, meta-title and meta-descriptions if the comment-page is not exclude from being index.

        It would be nice if WordPress has separate sub-section for comments like the attachments page.

        [Reply]
    • Madmouse Blogger Tips's photo
    • RE:Prevent Duplicate Content on Comment Paging
      9 months, 1 week ago on at 10:58 am3url · microId

      I have tried quite a few WordPress SEO plugins to deal with duplicate content. Some of them work very well, but I like to hard code as much as I can into my template. I just feel that at some point in time, I am going to experience plugin hell of some sort.
      I have been doing SEO for quite some time, but the more I learn the more I realize what I don’t know. Then, there is all of the stuff that changes to deal with as well. It is never ending and keeps a person thinking, that is for sure.

      Are you very experienced with robots.txt file configuration? It is hard to find someone that know their business in that field. I have contacted quite a few people and they never follow through with the goods.

      [Reply]
    • stalker's photo Kaizeku Ban
    • Prevent Duplicate Content on Comment Paging - 'Comment Guidlines' ↓
      11 months, 1 week ago on Thursday, December 4th, 2008 at 2:03 pm 5 url

      If you want to comment, please read the following guidelines. These are designed to protect you and other users of the site.

      1. Be relevant: Your comment should be a thoughtful contribution to the subject of the entry. Keep your comments constructive and polite.
      2. No advertising or spamming: Do not use the comment feature to promote commercial entities/products, affiliates services or websites. You are allowed to post a link as long as it's relevant to the entry.
      3. Keep within the law: Do not link to offensive or illegal content websites. Do not make any defamatory or disparaging comments which might damage the reputation of a person or organisation.
      4. Privacy: Do not post any personal information relating to yourself or anyone else (i.e., address, place of employment, telephone or mobile number or email address).

      In order to keep these experiences enjoyable and interesting for all of our users, we ask that you follow the above guidlines. Feel free to engage, ask questions, and tell us what you are thinking! insightful comments are most welcomed.

Subscribe to this discussion via RSS

1 2 3 4

"write as if you were talking to a good friend (in front of your mother)."

.haveyoursay

Disclaimer: For any content that you post, you hereby grant to Kaizeku Ban the royalty-free, irrevocable, perpetual, exclusive and fully sublicensable license to use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, perform and display such content in whole or in part, world-wide and to incorporate it in other works, in any form, media or technology now known or later developed. Some rights reserved.