
How to Delete Expired Transients in WordPress
Remove expired WordPress transients safely while accounting for valid cache entries and persistent object-cache storage.
A WordPress database grows in ways nobody chooses. Every saved draft leaves a revision, every plugin leaves options, every spam comment stays until something removes it, and expired temporary data often is not. A site with two hundred posts can carry a database of hundreds of thousands of rows, most of which nothing reads.
Size alone is not the problem — slow queries are. These guides start with finding out where the weight actually is, because the answer differs by site and guessing wastes effort. Usually it is post metadata, sometimes it is autoloaded options being read on every single page load, and on stores it is often a scheduler table nobody knew existed.
Then the cleanup itself, one category at a time: old revisions, expired transients, spam and trashed comments, metadata whose parent post no longer exists. Each article covers what is safe to remove and what looks disposable but is not.
There is also table optimisation, which reclaims space the database has marked free but not returned, and a short piece on how often any of this is worth doing.
One article here is not optional reading: the one on backing up first. Database cleanup is the one maintenance task with no undo, and a delete with a wrong condition is indistinguishable from data loss. Take the export, then run the query.

Remove expired WordPress transients safely while accounting for valid cache entries and persistent object-cache storage.

Remove obsolete WordPress revisions without deleting current content, active autosaves or editorial history your team still needs.