As i have explained yesterday in post POST AUTOSAVE INTERVAL IN WORDPRESS,When you add/edit the post or pages, wordpress automatically save your content in database in some intervals so admin can’t lost changes in any failure.
WordPress auto save versions of content as a revisions in the posts table. Yesterday I have explained that how we can manage this autosave interval in wordpress.
Today I am going to explain about to disable post revisions or limit the numbers of revisions per post in WordPress without making any changes into WordPress core file.You can manage this with the constant provided by wordpress in adding into wp-config.php
file.
Let’s see the code snippet to limit the the number of revisions or disable the post revision.
Limit the Number of Revision:
1 2 3 | define('WP_POST_REVISIONS', 2);// This will save 2 revisions of any posts/pages. |
Disable Post Revisions:
1 2 3 | define('WP_POST_REVISIONS', false ); // This will disable wordpress post revisions feature. |
Suggested Reading:
To import terms from csv in wordpress
Cron jobs in WordPress
SSL with WordPress
By Default this constant value in wordpress is TRUE.
Hope this tricks helpful to you.As always, thanks for reading an article. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.