Post revisions is a cool feature, but you probably know that it increase the size of your WordPress database. If you want to limit how many post revisions can be saved by WordPress, or even disabling this functionality, just read on.
Post revisions is a cool feature, but you probably know that it increase the size of your WordPress database. If you want to limit how many post revisions can be saved by WordPress, or even disabling this functionality, just read on.
To achieve this recipe, you have to edit your wp-config.php file. The wp-config.php file is WordPress configuration file, where you defined your database parameters when you installed WordPress. It is located on the root of your WordPress install.
To limit post revisions, just add the following lines:
define ('WP_POST_REVISIONS', 5); //Defines a maximum of 5 different revisions per post.
define('AUTOSAVE_INTERVAL', 3600); // Auto-saves on 1 hour interval
In this exemple, I have defined a maximum of 5 posts revisions. IF you don't want WP to save any revision, just type 0 instead of 5.
9 Responses
How does 600 work out to auto-saving every hour? I think you better check your math.
@Jason Trometter: It was a type, not a math error, but thanks for letting me know.
thanks for this tip Jean.
i was bothering with autosaves,
added codes,hope it works:)
cheers~
Aha that’s simple, making good result! Thanks
Long time reader first time poster etc.
Thanks for this tip. I often dip directly into the db for my own geeky reasons and it does get hard to see the wood for the trees with all the revisions that I never need.
Thanks much for your tips!
Cool tweak.
I’ve got a very limited hosting and don’t want my SQL DB to blow up.
Thank you SO MUCH for this tip, what a big help it is!!!!!!!!!!!!!
Trackbacks: