How to Manage WordPress Revisions and Clean Your Database

WordPress will automatically save WordPress revisions (copies) of your posts and pages you create.

This is very handy because it means that should your screen freeze or your computer crash then you are unlikely to lose your work or at least not all of it.

If you’re like me though you probably save to draft every time you add a paragraph or even an image. Its always in my mind “have you saved recently?”

Because the last thing that you want is that you create something substantial and then something happens and it is lost. The problem with saving is you are probably like me going to end up with 20 plus versions of your content saved from its very start to being published.

These revisions build up and create a sizable database on your site. Revisions don’t slow your site down as such but do use up space and this can be a problem if you have storage limitations on your hosting. And too many WordPress revisions will certainly slow your backup process down.

But we can fix this because after publishing. We don’t need 20 copies so they can be removed.

Firstly you can simply disable WordPress revisions if you want

I’m not really sure why you would want to do this but if you do then open the WordPress wp-config.php file and add the following configuration line to it above the “/* That’s all, stop editing! Happy blogging. */” line:

define(‘WP_POST_REVISIONS’, false );

This code stops new revisions from being stored and doesn’t remove any revisions created prior to adding this code.

Of course, it goes without saying BACK YOUR SITE UP  before you add the code.

PAC PLR CLUB

How to remove old WordPress revisions

There is an easy way to do this and a hard way. The hard way is adding some code. Just don’t, just use the easy way and that is just grab a WordPress Plugin.

I use a free plugin called Optimize Database after Deleting Revisions on Infobunny (no affiliation)

How to remove old WordPress revisions

Optimize Database after Deleting Revisions allows you set a number of revisions to keep. I like to keep the last couple of revisions just in case there is some kind of corruption somewhere. After deleting your database is automatically optimized.

Here are my suggested settings to tick to delete revisions and optimize your database after deletion. You can also exclude tables from being optimized. I leave all the tables un ticked.Wordpress revisions

There is a scheduling feature that you can use to keep your revisions in trim. I just like to use the one button feature when I see that my revisions are building up.

How to recover from a crash or a frozen screen on WordPress – GREAT WORDPRESS TIP

The revisions feature is there to protect you when your screen freezes or your laptop/desktop crashes. But before you reach for the restart option first check it’s not just a browser problem.

We can often just be too quick to shut down and restart. When we do this we are not sure as to whether we have lost content or not even with revisions. So before restarting just do this first.

1/ Open a new browser

2/ Go to your site and log inn to your admin

3/ Navigate to your post

4/ And just continue working

The problem is often just a browser issue so by opening a new browser resets without closing WordPress down allowing you to continue blogging

If you cant get to WordPress from a new browser then yes I’m afraid it is restart time. But revisions should have your back.

How to manage your WordPress revisions and optimize your database

Now it is over to you. Do you keep revisions? Do you delete them after publishing?

Let me know what you think in the comments below.

.ads in wordpress

Stay PAC Informed

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thanks for subscribing 🙂

Oops - Something went wrong.

PAC Loves You for Sharing!
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Discussion

  1. Pradeep Singh

Leave a Reply

CAPTCHA ImageChange Image

CommentLuv badge

By checking this box you\'re okay with PAC collecting your email so we can send you information. Please review our Privacy Policy. Your information is safe with us.