0

WordPress CommentsFolks, I get a lot of comments here on One Man’s Blog (nearly 7,000 at this point). Often there are well over 20 between times I check, even within one day, but the standard page view in the Edit Comments administration page only shows 20 thereby causing me to scroll from page to page in order to view / moderate more comments.

So, I just hacked mine to show 50 per page instead. Here is how you go about it.

  1. Open the /wp-admin/edit-comments.php document in your favorite text editor.
  2. Do a search for the number “20″. Eventually you will come across the following code:

    $start = $offset = ( $page – 1 ) * 20;

    list($_comments, $total) = _wp_get_comment_list( isset($_GET['s']) ? $_GET['s'] : false, $start, 25 ); // Grab a few extra

    $comments = array_slice($_comments, 0, 20);
    $extra_comments = array_slice($_comments, 20);

    $page_links = paginate_links( array(
    ‘base’ => add_query_arg( ‘apage’, ‘%#%’ ),
    ‘format’ => ”,
    ‘total’ => ceil($total / 20),
    ‘current’ => $page
    ));

  3. Change all 4 of the instances of the number “20″ above to “50″ – or however many you want to display per page.
  4. Change the 1 instance of the number “25″ above to “55″ – or 5 more than the number you display per page.
  5. After you modify it, the section should look like:

    $start = $offset = ( $page – 1 ) * 50;

    list($_comments, $total) = _wp_get_comment_list( isset($_GET['s']) ? $_GET['s'] : false, $start, 55 ); // Grab a few extra

    $comments = array_slice($_comments, 0, 50);
    $extra_comments = array_slice($_comments, 50);

    $page_links = paginate_links( array(
    ‘base’ => add_query_arg( ‘apage’, ‘%#%’ ),
    ‘format’ => ”,
    ‘total’ => ceil($total / 50),
    ‘current’ => $page
    ));

The good news is, this works perfectly. The bad news is, you’re going to have to redo this every time you update WordPress until we finally get a selection menu baked into the core.

DeliciousStumbleUponDiggTwitterTechnoratiFacebookLinkedIn

By the way, I LOVE comments! Please feel free to leave one below!

Tags: ,

Related posts

  1. Major Comments OverhaulOk. Tonight I made some major changes to the way comments are handled on the blog. Added a few ‘quicktags’...
  2. Tutorial: How To Put Ads on WordPress Home Page OnlyFolks, since my site has gotten fairly popular I have people who want to advertise on the home page. The...
  3. Tutorial: Add 3 Centered Columns to Wordpress FooterThis post describes how to add variable width, centered columns of stuff to the Worpress footer. Not sure what I...
  4. Should I Allow Comments on This Blog?Ok. Here is a question that is going to rile some people up. So, there is a site that wrote...
  5. Complete List of OMB WordPress PluginsI recently completed the upgrade to WordPress 2.3 and thought it was about time I gave some credit where credit...
  6. Lost CommentsI’m very sorry to those of you affected by this, but this evening I made a mistake and accidentally erased...
  7. Tutorial: Password Protect an Entire WordPress BlogRecently I had the need to set up a couple of blogs that I only wanted people who are logged...