How Do You Manage Revisions in WordPress

Share on facebook
Share on twitter
Share on email

WordPress post revisions are a historical list of changes you’ve made to your content.  If you need to revert back to an earlier version, post revisions have your back.

There’s more than one way to manage your post revisions, and you can choose the approach that works best for you.

Every serious WordPress content creator should know how to exploit the revisions feature. It's the best way to safeguard your precious work and prevent loss.

This guide covers the following four areas for WordPress revisions:

  1. Where to find post revisions in WordPress
  2. How to delete revisions in WordPress
  3. How to limit post revisions stored in WordPress
  4. How to disable post revisions in WordPress

First, let's take a quick look at what post revisions are and why you need them.

Post Revisions in Plain English

There are two types of WordPress revisions, i.e., automated and manual. The latter is when you click Save Draft, Update, or Publish from inside the editor. WordPress stores a permanent revision of your content to its database whenever you click on any of those buttons.

WordPress post revision is an essential feature that lets you undo unwanted changes. You can easily open an earlier saved version of any post or WP page.

WordPress also auto-saves a temporary revision of every draft you work on. It does this every 60 seconds (1 minute) by default. And each new save overwrites the previous version.

Note: The WordPress auto-save does not overwrite your published posts and pages.

Why Revisions Matter

Temporary revisions are a godsend. Computer crashes sometimes occur without warning. And internet connections can drop before you saved the content.

These things can happen to us all. Being able to restore the last auto-saved draft brings about a huge sigh of relief for many content creators.

Even experienced content writers make multiple adjustments to their work before publishing it. That could be a minor tweak or a major rewrite of certain sections. Post revisions allow you to review all the work to date as it evolves.

We'll look at how to utilise post revisions shortly.

#1 Where to Find Post Revisions in WordPress

You need to know how to access post revisions before you can exploit them.

Log in to your WP Admin Area.

Go to Posts => All Posts from the Dashboard side menu.

Click the Edit link under the post title you want to review the revisions for.

Point to note: It's the same procedure for pages as it is with posts.

WordPress opens your post in its Editor.

Navigate to and click on Revisions in the Post column (right-hand side).

The number tells you how many saved revisions there are for the post. In this case, it's 5.

You're now at the Post Revision screen.

The scrollbar along the top has a button that you can drag to navigate to earlier revisions. Alternatively, use the Next and Previous buttons.

How to Read the Revisions Screen

The revisions display tells you 3 things.

  1. What was added in the revision
  2. What was removed
  3. What remains unchanged

WordPress highlights content that an author adds or removes. A pink background shows deleted content, while green means added content.

Putting a tick (check) in the Compare any two revisions box lets you view two revisions side by side. This mode gives the slider two handles so you can choose which revisions to compare From and To. Clicking the Restore button restores the revision you're comparing TO.

Restoring a post or page to an earlier version does NOT replace or delete your current version. Instead, it gets stored in your database as another version.

Dragging the slider when comparing two revisions reveals a pop-up that tells you two things.

  1. Who made each revision
  2. When it was made, e.g., days, weeks, months + date & time

Seeing who made the revision is helpful if you run a multi-author website or blog.

Once you click Restore This Revision, WordPress takes you back to the editor. To make the revision permanent, you must save the draft or update the post, depending on its status.

#2 How to Delete Old Revisions in WordPress

WordPress stores old post revisions in the database, and they're pretty harmless. So why delete old revisions? The only reason is if you run a large site and want to reduce the size of your backups. Otherwise, it's perfectly okay to leave them alone.

There are two ways to delete old revisions.

  1. Use a WP plugin
  2. Via phpMyAdmin

The plugin approach is the quickest and most powerful, so let’s start with that. If you're new to WordPress or inexperienced with plugins, read my beginner's plugins guide first.

1) Delete Old Revisions Using a Plugin

Install and activate the WP-Optimize plugin by David Anderson.

Now go to WP-Optimize => Database from the Dashboard side menu.

You're now at the Optimization screen.

There may be ticks (checks) next to several optimisations already. Untick anything you don't want to optimise, but make sure there's a tick in the box…

Clean all post revisions, then click the Run Optimization button.

You can now deactivate or install the plugin if you don't want to keep it.

2) Delete Old Revisions Via phpMyAdmin

You can also delete old revisions via phpMyAdmin. That's only advisable if you're familiar with cPanel (your web hosting Control Panel).

PLEASE BACKUP YOUR WORDPRESS DATABASE BEFORE CONTINUING

Log in to cPanel for your WordPress website or blog.

Click the phpMyAdmin icon from the DATABASES panel.

Your phpMyAdmin opens in a new browser tab.

  1. Click your WordPress database name from the left-side column (see next image)

You will see a list of your WordPress database tables. The prefix is usually wp_ unless you or your website developer changed it.

  1. Next, click the SQL tab to open the phpMyAdmin SQL interface
  2. Enter the code below into the Run SQL query/queries window

DELETE FROM wp_posts WHERE post_type = “revision”;

Remember to change the wp_ prefix if you use something different.

  1. Click GO to run the command

That's it, phpMyAdmin deletes ALL your SAVED revisions from the WP database.

Point to Note: The above action does NOT prevent WordPress from saving revisions to newly created or updated posts.

#3 How to Limit the Revisions in WordPress

Advanced WordPress administrators can limit the number of post revisions without a plugin.

This method only takes a minute and assumes you're comfortable editing WordPress files. If not, jump to the second option and use the plugin instead.

Your File Manager opens in a new browser tab.

Select your public_html folder from the left of the screen.

Your site's files and folders will now load on the right of the window.

Locate and select your wp-config.php file, then right-click and select Edit from the pop-up.

The wp-config.php now opens in a new browsers tab.

Copy the code below, changing the limit number to however many revisions you want:

define(‘WP_POST_REVISIONS', 8);

Now paste the code near the top of your wp-config.php file below these lines:

* @package WordPress

 */

Click Save Changes.

Limit Revisions Using a Plugin

Please read my beginner's plugins guide first if you're a WordPress newbie.

Install and Activate the WP Revisions Control plugin by Erick Hitter.

Next, go to Settings => Writing

You'll notice there's a section at the bottom for WP Revisions Control.

Type your preferred number of revision limits for each post type, then click Save Changes.

#4 How to Disable Post Revisions in WordPress

The only time you might want to disable post revisions is if you constantly edit posts. Or, more specifically, you run a multi-author blog where the content creators are always editing.

That can result in an overly cluttered database that gets too big. But this only really happens if it's a massive site with many thousands of posts and or pages and regular updates.

The quick, easy way to approach this is with a plugin. The one we're going to use for this tutorial is Disable Post Revision by Joel James.

Install then activate the Disable Post Revision plugin from Dashboard.

Next, go to Settings => Writing from the Dashboard side menu.

You're now at the Writing Settings screen, where there's an option to Disable Post Revisions.

Select Posts or any other post types you want to disable the revisions feature for.

Tip: Hold the CTRL key down if you want to select multiple post types.

Scroll to the bottom of your Settings screen and click Save Changes.

That's all there is to it.

There's another way to do this if you want to restrict the number of active plugins on your site. It's a manual approach that assumes you know how to open and edit WordPress core files.

We're going to edit your wp-config.php file again from the cPanel File Manager.

See Limit Revisions from cPanel's File Manager above if you need a recap on opening files.

Log in to your cPanel, then click File Manager from the FILES panel.

Next, copy the code below.

define(‘WP_POST_REVISIONS', false );

Now paste the code near the top of your wp-config.php file below these lines:

* @package WordPress

 */

Click Save Changes, exit the file editor, and log out of cPanel.

The code disables your WordPress post revisions feature. However, WordPress still performs one auto-save and saves one revision, but no more.

Congratulations! You now know how to manage your revisions in WordPress.

Share on facebook
Share on twitter
Share on email

Subscribe to my newsletter

Subscribers to my newsletter get all the latest news, reviews, advice and gossip in the world of search engines, internet marketing, self-publishing, and North Wales (where I live). You can sign up for my free newsletter by clicking this link.

My Books

I have a range of webmaster related books for sale on Amazon in both Kindle and Paperback formats. WordPress, SEO & Self-Publishing.
On Amazon

My Online Courses

My courses cover a range of webmaster related skills, from learning WordPress itself, to installing an SSL certificate on your site.
On Udemy

Comments

Hello, I'm
Andy Williams!

You can get up to 90% off my Online Courses for webmasters, marketers & affiliates (plus a free course on Gutenberg).

Get my newsletter
delivered to your inbox

18748

We respect your privacy

18749