{"id":19675,"date":"2011-06-20T23:02:36","date_gmt":"2011-06-20T17:32:36","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=19675"},"modified":"2026-10-07T20:13:09","modified_gmt":"2026-10-07T14:43:09","slug":"delete-post-revisions-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/","title":{"rendered":"How to Delete Post Revisions in WordPress (and Limit Them)"},"content":{"rendered":"<p>How do you <strong>delete post revisions in WordPress<\/strong>? Revisions are WordPress&#8217;s built-in safety net: every time you save or update a post, it keeps a copy you can restore. But they pile up. Years ago our backup service showed QuickOnlineTips had over 4,000 posts and more than 8,000 revisions, double the number of posts, which explained why our database kept growing. We limited revisions and cleared out the old ones. Here is how to do the same in 2026.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19683\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/delete-post-revision.png\" alt=\"delete post revisions in WordPress\" width=\"446\" height=\"606\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/delete-post-revision.png 446w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/delete-post-revision-110x150.png 110w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/delete-post-revision-220x300.png 220w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Back up your database, then delete old revisions with a plugin such as WP-Optimize, Advanced Database Cleaner or the Database tab in LiteSpeed Cache. To stop them piling up again, add <code>define( 'WP_POST_REVISIONS', 5 );<\/code> to wp-config.php to keep only the last five revisions of each post.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6ada9ac028f35\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6ada9ac028f35\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Why_delete_post_revisions\" >Why delete post revisions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Step_1_Back_up_your_database\" >Step 1: Back up your database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Step_2_Delete_old_revisions\" >Step 2: Delete old revisions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Option_A_LiteSpeed_Cache_if_you_already_use_it\" >Option A: LiteSpeed Cache (if you already use it)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Option_B_WP-Optimize\" >Option B: WP-Optimize<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Option_C_Advanced_Database_Cleaner\" >Option C: Advanced Database Cleaner<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Option_D_WP-CLI_for_developers\" >Option D: WP-CLI (for developers)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Step_3_Limit_future_revisions\" >Step 3: Limit future revisions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Other_database_clean-up\" >Other database clean-up<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#How_to_check_how_many_revisions_you_have\" >How to check how many revisions you have<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Is_it_safe_to_delete_post_revisions\" >Is it safe to delete post revisions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Can_I_delete_revisions_for_a_single_post\" >Can I delete revisions for a single post?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/delete-post-revisions-in-wordpress\/#Do_revisions_slow_down_my_site\" >Do revisions slow down my site?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_delete_post_revisions\"><\/span>Why delete post revisions?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Smaller database:<\/strong> thousands of revisions bloat the wp_posts table, making backups slower and larger.<\/li>\n<li><strong>Faster queries:<\/strong> on large sites, a leaner database can speed up admin screens and some front-end queries.<\/li>\n<li><strong>Cleaner backups and migrations.<\/strong><\/li>\n<\/ul>\n<p>Revisions are useful, though. They have rescued many crashed or accidentally overwritten posts for us, so the goal is to limit them, not switch them off.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_1_Back_up_your_database\"><\/span>Step 1: Back up your database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Deleting revisions is permanent. Take a database backup first with your host&#8217;s backup tool or a plugin. See how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/10\/backup-restore-wordpress-database\/\">back up and restore your WordPress database<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_2_Delete_old_revisions\"><\/span>Step 2: Delete old revisions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Option_A_LiteSpeed_Cache_if_you_already_use_it\"><\/span>Option A: LiteSpeed Cache (if you already use it)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Go to <strong>LiteSpeed Cache &gt; Database &gt; Manage<\/strong> and click <strong>Post Revisions<\/strong> to clean them. You can also set how many revisions to keep under DB Optimization Settings.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Option_B_WP-Optimize\"><\/span>Option B: WP-Optimize<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Install <a href=\"https:\/\/wordpress.org\/plugins\/wp-optimize\/\" target=\"_blank\" rel=\"noopener\">WP-Optimize<\/a>, open <strong>WP-Optimize &gt; Database<\/strong>, tick <strong>Clean all post revisions<\/strong> (you can keep the last few weeks) and click Run optimization.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Option_C_Advanced_Database_Cleaner\"><\/span>Option C: Advanced Database Cleaner<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/wordpress.org\/plugins\/advanced-database-cleaner\/\" target=\"_blank\" rel=\"noopener\">Advanced Database Cleaner<\/a> shows exactly how many revisions, auto-drafts and trashed items you have and removes them by type, with scheduled cleanups.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Option_D_WP-CLI_for_developers\"><\/span>Option D: WP-CLI (for developers)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code>wp post delete $(wp post list --post_type=revision --format=ids) --force<\/code><\/pre>\n<p>On very large sites, run it in batches. Back in 2011 we used the Delete Post Revisions plugin, which took over 20 minutes and three runs to clear our 8,000 revisions; today&#8217;s tools are much faster.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19684\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/deleted-revisions.png\" alt=\"post revisions deleted\" width=\"440\" height=\"91\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/deleted-revisions.png 440w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/deleted-revisions-300x62.png 300w\" sizes=\"(max-width: 440px) 100vw, 440px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_3_Limit_future_revisions\"><\/span>Step 3: Limit future revisions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Add these lines to <strong>wp-config.php<\/strong>, above the &#8220;That&#8217;s all, stop editing!&#8221; line:<\/p>\n<pre><code>define( 'WP_POST_REVISIONS', 5 );   \/\/ keep the last 5 revisions per post\r\ndefine( 'AUTOSAVE_INTERVAL', 120 ); \/\/ autosave every 120 seconds instead of 60<\/code><\/pre>\n<p>Use <code>false<\/code> to disable revisions completely, but we do not recommend it. Some hosts and caching plugins also offer a revision limit setting, which does the same without editing files.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Other_database_clean-up\"><\/span>Other database clean-up<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While you are at it, clear auto-drafts, trashed posts, spam comments and expired transients; most cleaner plugins handle these in the same screen. For a deeper tune-up, read our guide to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/06\/optimize-wordpress-database\/\">optimize your WordPress database<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_check_how_many_revisions_you_have\"><\/span>How to check how many revisions you have<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Database cleaner plugins show a count before you delete anything, which is the easiest way to see the size of the problem. If you have phpMyAdmin access through your hosting panel, run <code>SELECT COUNT(*) FROM wp_posts WHERE post_type = 'revision';<\/code> (change wp_ if your table prefix is different). A few hundred revisions on a small blog is nothing to worry about; tens of thousands on a large, frequently edited site is worth cleaning up, ideally on a quiet day after a fresh backup.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_safe_to_delete_post_revisions\"><\/span>Is it safe to delete post revisions?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, once you have a backup. It does not affect published content, only the older saved versions.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_delete_revisions_for_a_single_post\"><\/span>Can I delete revisions for a single post?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The block editor lets you browse revisions but not delete them individually; database cleaner plugins can remove revisions per post.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Do_revisions_slow_down_my_site\"><\/span>Do revisions slow down my site?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually only on large sites with many thousands of revisions. Limiting them is good housekeeping either way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do you delete post revisions in WordPress? Revisions are WordPress&#8217;s built-in safety net: every time you save or update&#8230;<\/p>\n","protected":false},"author":4,"featured_media":19683,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-19675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/19675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=19675"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/19675\/revisions"}],"predecessor-version":[{"id":63532,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/19675\/revisions\/63532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/19683"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=19675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=19675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=19675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}