Tag Archives: wordpress

Change the number of comments per page in admin interface of wordpress

Let’s have this situation:

You need to make a backup of your blog, you have access only in the admin interface of wordpress and you have 3000+ comments containing spam in the ‘awaiting moderation’ state. Do you spend your day selecting 20 comments at a time and hittind the delete button? Hell, NO!

You hack the edit-comments.php file located in the wp-admin folder.
Locate the following line:

$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);

Now you need 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);

Save the file and check the display of the comments in the admin interface.