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.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.