- Get fast, reliable hosting for WordPress
- How to Delete Expired Transients & Post Revisions Using WP-CLI
- Backup Early, Backup Often
- Using WP-CLI to Perform a Manual Backup
- WordPress Transients – Why Should We Remove Expired Transients
- WordPress Transients – A Closer Look
- Ready to get started?Get the fastest, most secure WordPress.org hosting on the market.Additional resourcesWhat is managed WordPress hosting? →Get details and decide if managed WordPress hosting is right for you.Must-have web development plugins to create WordPress websites at scale →Explore the best web development plugins to enhance functionality, improve performance, and streamline your WordPress site.A complete guide to WordPress shortcodes →Shortcodes make life easier. Learn how to get started!
- Additional resources
Deleting Expired WordPress Transients & Post Revisions – Nexcess

WordPress management and WordPress maintenance are important aspects of overall site health. Deleting expired WordPress transients/post revisions is vital!
Get fast, reliable hosting for WordPress
Power your site with the industry’s fastest, most optimized WordPress hosting

WordPress management and WordPress maintenance are important aspects of overall site health. Deleting expired WordPress transients/post revisions is vital!
How to Delete Expired Transients & Post Revisions Using WP-CLI
Backup Early, Backup Often
It’s always a good idea to have a recent backup…
Before making any change to the settings for your WordPress site, it’s always a good idea to have a recent backup. If your WordPress site or WooCommerce portal is running on one of our managed WordPress hosting plans, you know one aspect of WordPress management that we handle for you is automatic daily backups of your content and data. However, since the most recent daily backup may have been performed hours and hours ago, please create a manual backup using your managed WordPress portal or using the WordPress Command Line Interface (WP-CLI) from inside the terminal.
Using WP-CLI to Perform a Manual Backup
Since we’ll be in a terminal session today using WP-CLI already, let’s create a quick backup from the command line.
First, after you’ve opened a Secure Shell (SSH) connection to your server, let’s make sure our working directory is the directory of our WordPress installation. In this example, our WordPress site is located in the default site document root, public_html.
We can see the WordPress configuration files, so we know we’re in the right place.
Next, we’ll run a quick backup of our WordPress database:
WordPress Transients — Why Should We Remove Expired Transients
WordPress intends for transients to be used for short-term caching of data inside the WordPress database. However, WordPress does not automatically delete expired transients. Instead, the creator of an expired WordPress transient (almost always a plugin) is expected to handle that aspect of WordPress maintenance. But some plugins that use transients do not always remove their respective transients after they expire. Over the span of months and years, these expired-but-not-deleted transients living inside the wp_options table of the database can begin to slow things down and impede site performance. For this reason, we should remove expired transients to improve WordPress site performance.
WordPress Transients — A Closer Look
Let’s make sure our version of WordPress supports transients.
In this example, we’re
In this example, we’re running with WordPress Version 5.1.6, first released in mid-2020. Because WordPress has supported transients since WordPress Version 2.8, our version is recent enough to have the supported transients included.
Though recent enough to have transients, our version in this example is slightly outdated and should be updated to a more recent version. See our blog post, WordPress Updates: How To Install an Update Safely, for a good guide on updating core WordPress.
And here are the transients in our example WordPress site:
As mentioned earlier, WordPress transients are not automatically deleted after expiration, so your list of transients may have more entries than this example list. However, from our example list above, you can see transients with expiration dates (the ones with a number) and ones without expiration dates (the ones labeled ‘false’).
The expiration value is time in seconds since midnight, January 1, 1970. For example, the transient named jetpack_akismet_key_is_valid has an expiration of 1641913553, which correlates to 2022-Jan-11 09:05:53am.
If you’re having caching or performance issues related to a specific transient, you can delete a specific transient by referencing the name:
Rather than remove each expired transient individually by name, we can tell WordPress to delete every expired transient quickly.
Additional resources
What is managed WordPress hosting? →
Get details and decide if managed WordPress hosting is right for you.
Must-have web development plugins to create WordPress websites at scale →
Explore the best web development plugins to enhance functionality, improve performance, and streamline your WordPress site.
A complete guide to WordPress shortcodes →
Shortcodes make life easier. Learn how to get started!