• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WordPress Tips, Code Snippets, and How To Tutorials

  • Home
  • Blog
  • Tips
  • Snippets
  • Tutorials
  • Contact

Post Revisions

How to limit the number of post revisions on your WordPress website without a plugin

October 30, 2019 by admin Leave a Comment

If you use WordPress on your website you may have noticed that when you edit a post WordPress often saves those revisions and if you use the screen options to display the post revisions you may see a really long list of revisions. You may want to limit the number of revisions that it has in that list without using a plugin. You can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to that on there.

/**
 * Limit post revisions
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', #);
if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', false);

You can then replace the # with the number of revisions you want per post like 3 or 4 or 5 for example. Now if that works for you it would limit the number of post revisions on the posts on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Post Revisions, WordPress Admin

How to delete unused post revisions from your WordPress Database

August 5, 2015 by admin 1 Comment

If you are like me, sometimes you update WordPress posts quite a lot, which can lead to a long list of Post Revisions for your posts. While this is very helpful if you need to go back to a recent version of the post, sometimes it can get cluttered.
[Read more…] about How to delete unused post revisions from your WordPress Database

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tips Tagged With: Database, phpMyAdmin, Post Revisions, SQL, SQL Queries

How to disable the Post Revision Feature in WordPress

July 18, 2015 by admin 1 Comment

The Post Revisions feature in WordPress saves copies of each edit made to a WordPress post or page. It allows you to revert back to a previous version of that post/page. Sometimes, this can be very helpful, and sometimes it can just clutter your Post/Page edit screen. This tutorial will show you how to disable the Post Revision feature in WordPress or alternatively, to specify the number of post revisions.
[Read more…] about How to disable the Post Revision Feature in WordPress

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tutorials Tagged With: Post Revisions, wp-config.php

Primary Sidebar

Hey, We Deliver... Anywhere!

Enter Email Address below to receive our snacks via email:

Join Over 1200 Readers!

Jump To A Random WordPress Tip

Copyright © 2019 • wpsnacks.com