Facbook Pixel


Remove WordPress comments from unregistered users

You can remove all comments from unregistered users in WordPress.

  1. Log into phpMyAdmin (cPanel / Plesk / Web Hosting / Managed WordPress).
  2. Select the database for your WordPress site in the left-hand column.
  3. Click the SQL tab.
  4. Paste the following query in the query field.
    DELETE wp_comments, wp_commentmeta FROM wp_comments INNER JOIN wp_commentmeta WHERE wp_comments.comment_id=wp_commentmeta.comment_ID AND wp_comments.user_id = 0; DELETE FROM wp_comments WHERE user_id = 0;
    Warning: If your WordPress database uses custom table prefixes, then you must replace wp_ in each command with the prefix listed in your wp-config.php file.
  5. Click Go.

More info