
Change Post Revisions by using WP-Config
- November 16, 2015
- Leave a comment
WordPress provides a functionality of post revisions which consequently spares the past condition of a post or page. When a change is made then it gives us the facility to go back to the past variant of that post or page in future. It will include some additional records in your Database. If you have a restricted space of Database or you don’t need pointless records, then you can disable post revisions too.
Change Auto-Save Time:
You can change the auto-save time of your post or page using WP-Config. You just have to open wp-config.php file located in the root of your project and add the following line in it:
1 |
define(‘AUTOSAVE_INTERVAL’, 300 ); // seconds |
Default auto-save time of a post or page is 60 seconds but after adding this code, it will save your post or page automatically after 300 seconds. You can change the value as you desire.
Change the number of Post-Revisions:
You can change the maximum number of post-revisions to be stored. For this, add the following line in your wp-config.php file:
1 |
define( ‘WP_POST_REVISIONS’, 3 ); |
Now your system will only save up-to 3 revisions of the post. You can change the value as you desire.
Disable Post-Revisions:
If you don’t want to see post revisions at all, then simply add the following line of code in your wp-config.php and your website won’t store any revision of your post:
1 |
define( ‘WP_POST_REVISIONS’, false ); |
Delete Revisions from Database:
Use the following Database line to delete all the previous revisions from your Database:
1 |
DELETE FROM wp_posts WHERE post_type = "revision"; |
User Comments