What are trackbacks?
Trackbacks are a legacy system that allows other blogs to notify you when they link to your content. Although similar to pingbacks, trackbacks are manually created by the sender and are often used by spammers. Modern WordPress sites rarely use them today.
How they affect your database?
Trackbacks are stored in the wp_comments table with the type trackback. Even though they’re outdated and often disabled, old installations may still contain many of them. These unused entries take up unnecessary space and can slightly affect performance and backup times.
How to clean them?
1. Using Advanced Database Cleaner plugin
You can easily delete old trackbacks using the General Cleanup module in Advanced Database Cleaner plugin.
This method is reliable, safe, and can be fully automated. You can set it to:
- Remove all trackbacks or keep only those created within the last X days.
- Use the Keep Last option to retain a limited number when needed.
- Schedule automatic cleanups to regularly delete unnecessary trackbacks.
2. Using a raw SQL query
If you prefer to handle it manually, run this SQL query in phpMyAdmin for example:
DELETE FROM wp_comments WHERE comment_type = 'trackback';
In multisite networks, run the same query for each subsite, replacing wp_ with the corresponding subsite prefix (for example, wp_2_, wp_3_, etc.).
Note:
While you can manually run these SQL commands to clean trackbacks, 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.