I am using wordpress and want to disable…

I am using wordpress and want to disable comments in my older posts. Please lend me a hand to do so?

3 comments to I am using wordpress and want to disable…

  • You may do it via PHP or MySQL. Here is a much easier method to do this via PHP.
    Open your theme’s functions.php file and run the given script:

    post_date_gmt ) > ( 15 * 24 * 60 * 60 ) ) {
    $posts[0]->comment_status = ‘closed’;
    $posts[0]->ping_status = ‘closed’;
    }
    return $posts;
    }
    add_filter( ‘the_posts’, ‘close_comments’ );
    ?>
    This script will stop the comments on all the articles posted more than 15 days ago. You may change the desired number of days by changing the number from 15 to whatever you like.

  • That’s the best anwesr of all time! JMHO

  • What a great web log. I spend hours on the net reading blogs, about tons of various subjects. I have to first of all give praise to whoever created your theme and second of all to you for writing what i can only describe as an fabulous article. I honestly believe there is a skill to writing articles that only very few posses and honestly you got it. The combining of demonstrative and upper-class content is by all odds super rare with the astronomic amount of blogs on the cyberspace.

Leave a Reply