ghacks Technology News

Wordpress Hack: Change Number Of Comments Per Page In Admin Interface


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.




Tags: , , , , , , ,
Categories: The Web



Related posts:

Wordpress Remote Admin Password Reset Vulnerability
Wordpress 2.5.1 released
Wordpress Issues
Free Anti Spam Plugin Antispam Bee For Wordpress
Wordpress 2.8
Wordpress 2.7
Wordpress 2.7.1 Update
Wordpress 2.8.2 Security Patch

4 Responses to “Wordpress Hack: Change Number Of Comments Per Page In Admin Interface”

  1. RG says:

    Thanx Martin. Like you said this one is easy but a heavily hacked Wordpress install has at least the potential of lots more work every time there is an update. I keep having to write down what I have done, at least most of the things I have done so far are in specific theme folders so they are sometimes unaffected with security or minor upgrades.

  2. Adrian Kuhn says:

    You saved my day, thanks!

  3. ultraspy says:

    I heart you! THANKS! You save me HOURS of work!

Trackbacks/Pingbacks

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

© 2005-2009 Ghacks.net. All Rights Reserved. Privacy Policy - About Us