scriptygoddess

14 Jan, 2009

Turn off WordPress Post Revisions

Posted by: Jennifer In: Bookmarks

I know wordpress people believe making this an option is bad, but I really really wish they would. Make an "advanced" settings section that you have to turn on with your profile if need be. Whatever it is – this should be in the UI. In any case, I always have to do this, and I always forget the exact syntax. I think many places published it – I've probably seen it at least a dozen times. Just now when I was searching for it I found it here. But because I need to have the code handy here's the beef:

(add this to the wordpress config file after the "DB COLLATE" line.
define ('WP_POST_REVISIONS', 0);
define('AUTOSAVE_INTERVAL', 600);

This sql query will remove the revisions from the database:
DELETE FROM wp_posts WHERE post_type='revision';

Go to the abeontech link for more details.

4 Responses to "Turn off WordPress Post Revisions"

1 | Joseph Scott

January 14th, 2009 at 4:49 pm

Avatar

Any particular reason why you need to turn off post revisions?

2 | Jennifer

January 14th, 2009 at 5:01 pm

Avatar

I don't like that they live in the database indefinitely. They also mess up some of custom theme hacks I've done. (Where I've used wordpress as a mangled content management system). I just don't have any use for it.

Now, being able to publish posts that are dated in the future – THAT I could really use. It may seem silly – and not what the "original intended use for wordpress" is – but I use that hack very often in various installs I've done. (and I hate having to hack core code to get it to do that!) I've tried writing a plugin for it and it didn't work. I tried using someone else's plugin and that caused all kind of problems. (This is one of those plugins I was hoping to be able to figure out how to write after the wordcamp meeting) :(

I know there are some specific ideas about how wordpress is to be used, but one of the things I love MOST about wordpress is how flexible it is (99.9% of the time) ;p I have clients come to me all the time with random crazy things they want to do and I'm like… you know, we can do it with wordpress and some custom query calls, and custom fields etc etc.

In any case – back to your original question. It's just a bulky feature I want to be able to turn off because I'm a tweaker. :)

3 | Jennifer

January 14th, 2009 at 5:04 pm

Avatar

Oh also – re: the autosave… it freaks me out that when I'm editing a post and maybe re-reading it for a while, it does an autosave and then tells me the version I'm editing is older than an autosave version…??

4 | Abeon Tech

February 1st, 2009 at 2:51 pm

Avatar

The main problem for me is the size of the SQL database after say 1000 posts, with 10 edits each (some a lot more!).
The strain that puts on the site is just not needed.

As your self one question:
Do I use the revisions?

If it's no, then it may be worth using the methods listed to disable them.
Some people like having them to fall back on. And if you don't have a large amount of posts, you may want to leave it enabled.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements