database

How do I delete unapproved WordPress comments from my MySQL database?

Sometimes when you fall behind in moderating your WordPress site you end up with a lot of comments from spammers, bots, etc. You can connect to the database manually and clean up as needed.

Here are a few handy SQL commands to assist you:

To delete all unapproved comments with the keyword “prescription”. Just replace %prescription% with whatever keyword you’d like to search form.

delete from wp_comments where comment_content like ‘%prescription%’ and comment_approved=0;

To delete all unapproved comments:

delete from wp_comments where comment_content like ‘%prescription%’ and comment_approved=0;

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top