What are pingbacks?
Pingbacks are automatic notifications that WordPress sends when another site links to your content. Similarly, your site receives pingbacks when other WordPress sites reference your posts. Although useful for networking, they can often be spammy and unnecessary.
How they affect your database?
Pingbacks are stored as entries in the wp_comments table with the type pingback. Even if they’re disabled or unapproved, they still occupy database space and can contribute to table bloat, slightly affecting performance and backup size over time.
How to clean them?
1. Using Advanced Database Cleaner plugin
You can safely delete pingbacks using the General Cleanup module in Advanced Database Cleaner plugin.
This method is secure, flexible, and can be fully automated. You can configure it to:
- Remove all pingbacks or keep recent ones within a specific number of days.
- Use the Keep Last feature to retain a certain number if needed.
- Schedule automatic cleanups so pingbacks are deleted regularly without manual effort.
2. Using a raw SQL query
If you prefer a manual cleanup, run this SQL query in phpMyAdmin for example:
DELETE FROM wp_comments WHERE comment_type = 'pingback';
For multisite installations, execute this command for each subsite, replacing wp_ with the subsite’s prefix (for example, wp_2_, wp_3_, etc.).
Note:
While you can manually run these SQL commands to clean pingbacks, we strongly recommend using the Advanced Database Cleaner plugin.
It uses WordPress’s internal cleaning methods, automatically handles multisite installations, and ensures that all related data is safely removed while keeping your database consistent and stable.