Wordpress: Limit # of Post Revisions


/ Published in: PHP
Save to your folder(s)

If you make a lot of edits, eventually the revisions will start to bother you or bog down your database. Heres how you can put a cap on the number of recorded revisions.


Copy this code and paste it in your HTML
  1. function limit_post_revisions(){
  2. //limit the number of posts revisions that WordPress stores
  3. define( 'WP_POST_REVISIONS', 3);
  4.  
  5. define( 'AUTOSAVE_INTERVAL', 180 );
  6.  
  7. }
  8. add_action('init', 'limit_post_revisions');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.