WordPress is displaying 20 comments per page in the admin interface. This might not be a problem for users who usually get a handful of comments per day but it forces webmasters with hundreds of comments per day to flip through the pages quite often. The 20 comments per page figure is actually the figure for both the approved comments and the comments identified as spam.
Another thing that is really annoying in WordPress 2.7 is the fact that you can either delete all comments on the page, selected comments or all spam comments at once. At 20 spam comments per page and thousands in total this can take a long time to flip through and delete.
The WordPress hack is actually quite easy to perform even for webmasters who have no knowledge whatsoever regarding html and php. The file that is responsible for the amount of comments that are displayed is called edit-comments.php. It can be found in the wp-admin folder. Make sure you backup that file before you apply the changes so that you can revert back if something should go wrong.
Locate the following line in the file, it should be around line 182 in the file:
$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
The only thing that you need to do is to change the figure 20 to another figure, e.g. 100 so that it looks like this:
$comments_per_page = apply_filters('comments_per_page', 100, $comment_status);
Just save the file again and check the display of the comments in the admin interface to make sure everything is working correctly.
Update: Newer versions of WordPress support this feature natively, so that it is no longer necessary to make changes to WordPress core files.
All you need to do is click on Screen Options at the top right of the comments page, and change the number of comments per page to another value.Advertisement
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.