
To clear all comments from a WordPress database, you can run the following SQL command:
DELETE FROM wp_comments;
DELETE FROM wp_commentmeta;
Explanation:
-
wp_comments
: Deletes all comments. -
wp_commentmeta
: Deletes all metadata associated with the comments.
Important Notes:
- back up your database before running SQL commands.
- wp_, adjust the table names accordingly.
Would you like help running this via WP-CLI instead?
All comments on a WordPress website are displayed on the Comments dashboard in your WordPress admin area. It displays all comments by default.
To deactivate WordPress comments, go to Settings > Discussion in your dashboard and uncheck “Allow people to submit comments on new posts.”