In certain situations removing unwanted comments within WordPress can be a cumbersome and time consuming process. Out of the box your only option is to adjust the number of comments per page via Screen Options (top right of screen) within the WordPress Dashboard. Well if you accidentally forgot to disable comments on a particular page, post, product, or media (be sure to disable attachment pages) you could have thousands of comments and unfortunately WordPress limits you to seeing a max of 999 items per page. Here is a quick and easy way to delete all comments using phpmyadmin:
1. Login to your customer control panel via https://cp.infoquest.com > click the “More Services” Tab > click “Databases”
2. Next you will want to click the specific database name for the specific database you’re using for WordPress (verify db within wp-config.php)
3. After you click the database name you will see a link to “Browse database manager” which will open phpmyadmin.
4. Within phpmyadmin, in the top left corner, click your specific database name (ie db1000000_sa000_main) to load your Tables.
5. Once you see a list of database Tables > click “wp_comments” (Note: In case your db tablle prefix is not “wp_” then replace the “wp_” below prefix with yours) > at the top, click “SQL” to open the SQL queries window. Here are a list of various ways to delete WordPress comments:
If you want to remove NON APPROVED COMMENTS then run the following query:
DELETE from wp_comments WHERE comment_approved = '0'
If you want to remove ALL PENDING COMMENTS then run the following query:
DELETE from wp_comments WHERE comment_approved = '0'
If you want to remove ALL APPROVED COMMENTS then run the following query:
DELETE from wp_comments WHERE comment_approved = '1'
If you want to remove ALL TRASH COMMENTS then run the following query:
DELETE from wp_comments WHERE comment_approved = 'trash'
If you want to remove ALL SPAM COMMENTS then run the following query:
DELETE from wp_comments WHERE comment_approved = 'spam'