PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, October 24, 2022

[FIXED] How to Disable Page Revisions in WordPress?

 October 24, 2022     php, wordpress     No comments   

Issue

How can I remove Page Revisions in WordPress?

My goal is to reduce the database size.

I am using the code below, but page revisions are still enabled.

define ('WP_PAGE_Revisions', false);

Solution

Another use case is If you’re like most people, you’ll want to have a couple of post revisions for each post you add to your blog – just err on the safe side. The best way to accomplish this is to set a hard limit on the # of post revisions that are saved to the wordpress DB. You can try adding the following code (1 line) to your wp-config.php

define( ‘WP_POST_REVISIONS’, 3 ); 

What this line of code will accomplish is that it will save the 3 most recent post revisions instead all of the revisions and it will automatically delete as newer revisions occur.

Of course feel free to replace (3) with your ideal number of post revisions you would like to keep



Answered By - Dimitar Coklev Димитар Чоклев
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing