phpMyAdmin can remove a WordPress comment directly from the database when the dashboard is unavailable. This guide explains the database checks needed to delete one comment and its associated metadata.
Before you start
Use WordPress > Comments where possible. WordPress also handles reply relationships, cached data and plugin actions when deleting a comment normally.
Back up the database. Confirm the website’s database and table prefix in wp-config.php; replace wp_ below with the actual prefix. Direct deletion is permanent and does not move a comment to Trash.
Identify the comment
-
Open phpMyAdmin from your hosting panel and select the correct database.
-
Open the comments table, normally
wp_comments, and find the comment. -
Check its content, author, comment_ID, comment_post_ID and comment_type. Record the comment and post IDs.
-
Check for replies by running this query in SQL, replacing
123with the comment ID:SELECT comment_ID FROM wp_comments WHERE comment_parent = 123;
If replies exist, or the record belongs to a plugin rather than an ordinary comment, use WordPress’s deletion tools instead of this direct method.
Delete the comment and metadata
Run both statements with the confirmed ID and table prefix:
DELETE FROM wp_commentmeta WHERE comment_id = 123;
DELETE FROM wp_comments WHERE comment_ID = 123;Check for errors and confirm that the intended comment is gone.
Check the website afterwards
Ask your administrator to refresh affected comment counts and relevant caches. If WP-CLI is available, they can run the following from this site’s WordPress directory, replacing 456 with the recorded post ID:
wp comment recount 456Check the post and remaining comments. Direct SQL does not run the normal WordPress deletion hooks, so plugin-managed records need their own supported removal procedure.