Follow these steps to limit the number of allowed revisions for posts:
- Open the wp-config.php file in the code editor.
- Find the comment that says /* That’s all, stop editing! Happy publishing. */ inside the wp-config.php file and add the following line of code before the comment:
define( 'WP_POST_REVISIONS', 5 );
- Save the changes to the file.
Now, the revisions will be limited to five per post. Follow these steps to check if the revisions are limited to five:
- Log in to Dashboard as an administrator.
- Use the Posts | Add New option to create a new post.
- Click the Publish button to publish the post.
- View the URL and get the ID of the created post. It should look similar to the following:
http://www.example.com/wp-admin/post.php?post=897&action=edit ...