Support » How-To and Troubleshooting » Non-functional Empty Spam button

Non-functional Empty Spam button

  • If a user has moderate_comment capability and access to the Comment Panel, the Empty Spam button appears, but it doesn’t actually empty the spam when clicked.

    In general, I don’t understand the weirdness in the WordPress core about moderating comments. If a user has moderate_comment capability, they SHOULD have access to the Comments Panel and they should be able to moderate comments. Neither of those really happens. In order to see the Comments Panel, you have to give the user the totally-unrelated edit_posts capability, and even then, the Empty Spam is tied to yet some other capability that I don’t even know.

Viewing 9 replies - 1 through 9 (of 9 total)
  • esmi


    Forum Moderator

    Are you talking about Editors and Admin users?

    I’m not sure I understand your question. I’m not talking about roles, but about capabilities.

    Go to the Codex here:


    It says: that the moderate_comments capability “allows users to moderate comments from the Comments SubPanel (although a user needs the edit_posts Capability in order to access this)”

    If you give users moderate_comments and edit_posts capability, they can see the Comment SubPanel in the Admin interface, and there is an “Empty Spam” button shown them, but it doesn’t do anything but refresh the screen.



    Forum Moderator

    Are you referring to the standard Editor & Admin roles or have you been customising the user capabilities?

    I created a new role using the User Role Editor plug-in.



    Forum Moderator

    Have you tried posting about this in the plugin’s dedicated forum?

    The plug-in author, on this page

    moderate_comments WordPress user capability

    details issues with WordPress moderate_comments capability and why there’s nothing related to his plug-in that can deal with these problems.

    It’s not related to the plug-in. It’s a button that doesn’t work. It’s a bug.



    Forum Moderator

    That post is over 18 months old! We’ve had 6 core updates since then.

    I do not understand why we are even having a discussion about a plug-in.

    You may have had 6 core updates, but the button is still broken. Capabilities were added in WordPress 2.0, and the moderate_comments capability doesn’t let someone moderate comments in WordPress 3.6. WordPress 3.6 displays a button that does nothing.

    I posted this comment to get some help and to possibly report a bug. Perhaps somebody can move that discussion forward.

    The code seems to indicate that the moderate_comments capability is INTENDED to allow emptying spam. Here’s the code from class-wp-comments-list-table.php:

    if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {
    			wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    			$title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
    			submit_button( $title, 'apply', 'delete_all', false );

    It would also appear that in edit-comments.php, the code INTENDS for the user capability of edit_posts is required for Empty Comments; however giving a user that capability doesn’t make it work either.

    It looks like the code was half modified to support the moderate_comments capability, but never finished.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Non-functional Empty Spam button’ is closed to new replies.