How to do it...

Follow these steps to limit the number of allowed revisions for posts:

  1. Open the wp-config.php file in the code editor.

 

  1. 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 );
  1. 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:

  1. Log in to Dashboard as an administrator.
  2. Use the Posts | Add New option to create a new post.
  3. Click the Publish button to publish the post.
  4. 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
  1. Log in to phpMyAdmin.
  2. Go to the database for your WordPress installation.
  3. Click the SQL tab and enter the following query:
SELECT * FROM `wp_posts` WHERE post_type='revision' and post_parent=897
ORDER BY `wp_posts`.`post_date` DESC
  1. Click the Go button to execute the query.

You will see a maximum of five records returned from this query. You can update the content of the post multiple times and execute the query again. The resulting count won't exceed five no matter how many times you edit the post.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.240.119