My WordPress Post Revisions Problem

Wordpress post revisions

While many functions in WordPress (the self-hosted kind) work like a charm, this one gave me the run-around a few days ago: The auto-saving post revisions that got added to WordPress a few releases back.

On our departmental website ( that I created in WordPress (works great for this purpose, it’s the “Just-enough CMS!”) we had a problem where our longer pages wouldn’t show the visual editor when we tried to edit a page. The recent problem happened especially on this page. If you look at the entire thing, you’ll notice that the text body consists of approx. 2700 words. It happened on other pages, too – all very long pages.

As it turns out, WordPress was saving an unlimited number of revisions for these pages. Unbeknownst to me, there is no limit set in WordPress on the number of revisions – which inevitably leads to a rapid increase of the size of the posts database table. This did then lead to some kind of a time-out when the WordPress admin page was rendered, which prevented the WYSIWIG editor from loading.

The fix for this is to add a line like any of the following two examples to the wp-config.php file in the WordPress root directory. I will make sure I set this on all of my sites from now on! Having revisions is great but there’s no reason to push it too far (especially on shared hosting).

/* Limit post revisions to 20 */
define('WP_POST_REVISIONS', 20);
/* Disable post revisions altogether */
define('WP_POST_REVISIONS', 0);

It is also important to realize that these settings only take effect after they are set and a page is re-saved. To do a wholesale revisions cleaning of an entire blog (which I still may do to reduce the database size), it is better to look for a plugin that does that automatically.

Comments and Reactions