Limit or disable revisions for pages and posts – WordPress Tutorial

Revisions in WordPress are intended as a backup for your blog. This means that every change can be revised at a later date. This makes it possible to jump back to earlier changes in the post, for example if errors occur. Yesterday I had an interesting conversation. We also talked at some point about this problem, which requires more database capacity than is often necessary. Also the MySQL database itself is very bloated.

At the end of the article there is also a tip on cleaning the WP database.

+ AD: Do you know?

WP Limit or disable revisions for pages and posts

The solution to this problem can be found in the wp-config.php How to edit it you can find here in the WordPress Guide. There are two options to limit or disable page and post revisions in the WordPress backend. To do so, you have to modify the wp-config.php in the root directory of your WordPress installation:

website-wordpress-pages-contributions-revisions-disable-limit-wp-config-file

solution 1: disable page and post revisions

The value here may vary depending on how many revisions are to be available:

/**
* Revisions
*/
define('WP_POST_REVISIONS', 5);

Solution 2: Disable page and post revisions

/**
* Revisions
*/
define('WP_POST_REVISIONS', false);

In the forum on WPDE.org I also found the following PHP line to delete existing revisions via phpMyAdmin:

+ AD: Do you know?

Tip: Clean WordPress database

DELETE FROM wp_posts WHERE post_type = "revision";

You simply enter the targets in the phpMyAdmin backend under Menu > SQL > ‘Insert code’ > OK (confirm). Don’t forget to target a backup of the database first.

website-wordpress-pages-contributions-revisions-disable-limit-phpmyadmin-database

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply