Black Friday - Cyber Monday Sale
30% OFF All Premium Licenses
  • 00 Days
  • 00 Hrs
  • 00 Mins
  • 00 Secs
Use code
SIGMA30

This 30% discount applies only to the first year. From the second year, renewals are charged at the regular price.

What are WordPress auto drafts and how to clean them?

Younes JFR.

What are auto drafts?

WordPress automatically creates an auto draft when you start writing a new post or page but haven’t saved or published it yet. These temporary entries help you recover content if you close the editor or lose connection before saving. After you publish the post (or save a regular draft), these auto-draft entries are no longer needed and can be safely removed.

How they affect your database?

Each auto draft is stored as a separate row in the wp_posts table with the status auto-draft. Over time, especially on busy sites, these leftovers can add up, increasing your database size and slightly impacting operations like queries, backups, and exports.

How to clean them?

1. Using Advanced Database Cleaner plugin

You can easily remove old auto drafts using the General Cleanup module in Advanced Database Cleaner plugin.

This method is safe, flexible, and fully automated. You can customize the cleanup to:

  • Delete all auto drafts or keep only recent ones (e.g., keep auto drafts newer than X days).
  • Retain a limited number per post using the Keep Last feature (when applicable to the item type).
  • Schedule automatic cleanups so old auto drafts are removed regularly without manual work.

2. Using a raw SQL query

If you prefer a manual method, you can run the following SQL in a tool like phpMyAdmin:

DELETE FROM wp_posts WHERE post_status = 'auto-draft';

For multisite networks, execute the query per subsite, replacing wp_ with the subsite’s table prefix (for example, wp_2_, wp_3_, etc.).

Note:
While you can manually run these SQL commands to clean auto drafts, 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.