Forums

How to Display all spam comments in one screen in 2.7.1 (4 posts)

  1. BenRoss
    Member
    Posted 3 years ago #

    Hello-
    This is my first time posting, and I apologize if this topic has been discussed. (I googled it for about half an hour and couldn't find anything). I have been using wordpress for several years and this week upgraded to 2.7.1, and have a little problem which is turning into quite a nuissance. Like any wordpress blog, I get a mountain of spam every day. Several months ago I started using Peter's Random Anti-Spam plugin, which completely eliminated all of my spam for a while. Then after several weeks I started getting spam pings (just those short ones soliciting prescription drugs and beastiality websites). The volume was much lower than before, so it wasn't a big deal. Over time, I kept getting more and more of them, but still it wasn't nearly as bad as it was before. I would just log in once every couple days and clear them all out.

    This week I upgraded to 2.7.1. One new "feature" I have noticed is that now all comments are displayed only 20 at a time. In the old version (I forget exactly which one it was I was using), it would display all of my comments in a single page. The advantage of this was that if I had 287 spam comments, I could delete them all with a single keystroke. Now I am having to go in and delete them 20 at a time. My connection isn't the fastest in the world, and this is turning into a huge pain. So here are my questions.

    Firstly, is there a hack, or some setting I'm missing in 2.7.1 where I can view ALL spam comments (and delete them) in a single screen.

    Secondly, and even better. Is there a plugin which would get rid of all these stupid pings once and for all. I have been a little hesitant to implement many anti-spam measures in the past because of fear of false positives. Basically, I'd rather spend a couple minutes a day clearing out spam, rather than risk losing a couple legitimate comments.

    Thanks in advance for any help.

  2. t31os
    Member
    Posted 3 years ago #

    You'll have to modify a core file with each upgrade, but i believe the limit is set here...

    Line 185 / edit-comments.php in /wp-admin/
    $comments_per_page = apply_filters('comments_per_page', 20, $comment_status);

  3. ben.bland
    Member
    Posted 2 years ago #

    Thanks t31os - spot on suggestion.

    I had 1500 comments to delete so I tried to make the comment_per_page value 500 but it produced this error:

    Request-URI Too Large
    The requested URL's length exceeds the capacity limit for this server.

    Just for future reference, I tried different values at multiples of 100 and the highest allowed was 200. Other people Might find a similar issue.

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    My previous statement here was incorrect (back when i was still learning WP basics etc..), that piece of code i posted above actually shows there is a hook available to change the number without modifying the core file..

    Untested, but should work..

    add_action( 'admin_init' , 'my_admin_init_hooky' );
    function my_admin_init_hooky() {
    	add_filter( 'comments_per_page' , 'mod_comments_per_page' );
    }
    function mod_comments_per_page( $number ) {
    	return 100; // Adjust 100 to your desired amount
    }

    Theme functions file would be fine.

Topic Closed

This topic has been closed to new replies.

About this Topic