Free tools Windows power users keep installed
One-click scans. No signup required.
To stop WordPress from storing regular post revisions, add this constant to wp-config.php before WordPress loads its configuration:
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
define( 'WP_POST_REVISIONS', false );
WordPress keeps revisions enabled, with an unlimited history, when the constant is not set. Setting it to false (or 0) removes regular revision records from future saves, but it does not turn off autosaves. If you need rollback capability without unlimited database growth, use a positive number such as 3 instead.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What disabling revisions actually changes
A revision is a stored earlier version of a post or page. WordPress can use those versions to compare edits and restore an earlier draft or published version. The WP_POST_REVISIONS constant controls how many regular revisions WordPress retains for each post.
When the constant is absent, WordPress’s documented default is to keep an infinite number of revisions. Every substantial update can therefore add another row to the database. Over time, a site with frequently edited content can accumulate a large history even when editors rarely use it.
#1 Best Overall
Setting the value to false disables regular revisions. Setting it to 0 has the same documented no-revision effect. This policy applies globally unless a filter changes the result for particular posts or post types.
Autosaves are a separate mechanism. They are temporary recovery copies and do not overwrite the published version. Disabling regular revisions does not remove autosave behavior, so the editor can still recover from a browser crash or interrupted editing session in the situations WordPress supports.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsDisable regular revisions step by step
1. Make a recoverable copy
Before editing a PHP configuration file, create a current backup of the site and, if possible, test the change on staging. Keep an untouched copy of wp-config.php so you can restore it immediately if a syntax error prevents the site from loading.
2. Open the correct file
Edit the site’s root wp-config.php, not the sample file and not a theme’s functions.php. The file normally sits above the wp-admin, wp-content, and wp-includes directories. Use your host’s file manager, SFTP, or another method that preserves plain-text PHP files.
3. Add the constant near the beginning
Place the line immediately below the initial comment block, before WordPress loads its configuration. The official handbook specifically recommends this early placement when the setting appears ineffective. Do not put the line after the final loading statement or inside a function.
define( 'WP_POST_REVISIONS', false );
If the file already contains a WP_POST_REVISIONS definition, edit the existing definition rather than adding a second one. A constant should be defined once; duplicate definitions can cause warnings and make it unclear which policy you intended.
4. Preserve valid PHP syntax
Keep the semicolon, straight quotation marks, and the surrounding PHP structure intact. The constant belongs inside the file’s opening PHP section. Do not paste Markdown fences into the file, and do not add a closing PHP tag merely to insert this setting.
5. Save, clear relevant caches, and test
Save the file, then open the WordPress editor and update a test post. The change governs future saving and pruning behavior, so it does not retroactively rewrite the site’s existing revision rows. Confirm that the editor still loads, the post updates normally, and no PHP error appears in the site’s error log.
Rank #3
Disable versus limit: choose the policy that fits the site
Removing regular revisions is not the only way to control database growth. A positive integer retains a bounded history while preserving rollback. The documented value semantics are:
| Value | Regular revisions | Autosave behavior | Typical result |
|---|---|---|---|
false or 0 |
None | Autosaves remain available; documentation describes one autosave per post | Smallest regular revision footprint, no normal revision rollback |
Positive integer, such as 3 |
That many revisions per post | One autosave per user in addition to the retained revisions | Bounded history with limited rollback |
true or -1 |
Every revision | Autosaves remain available | Unlimited revision history, the documented default behavior when enabled |
For example, this keeps three regular revisions:
define( 'WP_POST_REVISIONS', 3 );
When the post is updated again, older revisions beyond the limit are automatically deleted. The limit is per post, not a promise that the whole database will contain only three historical rows: autosaves and revisions for other posts are governed separately.
When disabling is appropriate
- Editors never use the revision browser and the site has a separate content backup process.
- Posts are generated or updated frequently and unlimited history is creating unnecessary database growth.
- You want the simplest global policy and accept that normal revision rollback will not be available.
When a positive limit is safer
- Multiple people edit content and an accidental change must be recoverable.
- Published pages are revised often and a short rollback window is valuable.
- You want predictable storage without removing the editor’s normal revision workflow entirely.
A small limit such as three is a policy choice, not a universal optimum. Choose a number that covers the site’s realistic correction window, then verify the resulting storage and recovery workflow on staging.
Use filters for conditional or post-type-specific control
The constant is global, but developers can make retention conditional with the wp_revisions_to_keep filter. The callback receives the current number and the WP_Post object; its return value determines how many revisions WordPress keeps for that post.
Rank #4
add_filter( 'wp_revisions_to_keep', function ( $num, $post ) {
if ( 'page' === $post->post_type ) {
return 5;
}
return $num;
}, 10, 2 );
In this example, pages retain five revisions while other post types keep the value supplied by the existing configuration. The callback must return a numeric retention policy for every branch. Test the policy with each relevant post type before deploying it.
Post-type-specific hooks
WordPress also exposes dynamic hooks such as wp_post_revisions_to_keep and wp_page_revisions_to_keep. A post-type-specific hook overrides both the global constant and the general wp_revisions_to_keep filter. This precedence matters when a site has several snippets or plugins changing revision retention: the most specific hook can win even when the global value says something else.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Where to put conditional code
Keep the filter in a maintainable, site-controlled location, such as a custom plugin or the site’s existing functionality layer, rather than scattering it through a theme that may be replaced. Avoid adding several callbacks that return conflicting values. Document the intended policy and remove obsolete callbacks when the content model changes.
Disable, limit, or filter: a practical comparison
| Approach | Recovery capability | Database growth | Configuration complexity | Scope |
|---|---|---|---|---|
Disable with false or 0 |
No regular revision browser history; autosaves remain separate | Stops new regular revision accumulation | Low: one constant | Global by default |
| Limit with a positive integer | Retains the selected number of rollback points | Bounded per post; older excess revisions are pruned on later updates | Low: one constant | Global by default |
| Filter-based policy | Can preserve history for selected types or conditions | Depends on each callback’s returned value | Higher: PHP callback and precedence testing | Conditional or post-type-specific |
Placement and syntax problems to check
The setting appears to do nothing
- Open the active
wp-config.phpand confirm the line is present there, not only in a sample or staging copy. - Check that the constant is placed near the beginning, immediately beneath the initial comment block and before WordPress loads its configuration.
- Search the file and your custom plugins for another definition or filter that changes the value.
- Remember that changing the policy does not erase revision rows that were already stored. A revision list that still shows old entries is not proof that future retention is enabled.
The site shows a PHP error after saving
Restore the backup copy first, then compare the edited line character by character. The most common repair is removing a duplicated or malformed definition and ensuring the line is inside the existing PHP section with a terminating semicolon. Make the correction on staging before trying again on production.
Best Value
Editors can still recover a draft
That is expected when the recovery copy is an autosave. The constant targets regular revisions; autosaves are intentionally separate so an interrupted editing session can still be recovered without replacing published content.
Only some content types retain history
Inspect conditional code and dynamic hooks. A post-type-specific filter takes precedence over the global constant and the general filter, so one content type may legitimately have a different retention number.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWhat happens to revisions already in the database?
The setting controls future saving and pruning. It does not, by itself, guarantee deletion of every revision row that existed before the change. Existing records therefore require a separate cleanup decision.
Do not run an unverified SQL statement copied from a forum as a universal solution. A destructive cleanup can remove recoverable content or affect data in a customized installation. Make a full database backup, identify the site’s WordPress version and database structure, and validate any cleanup procedure in a disposable copy before considering production use. If you cannot verify the procedure, leave the historical rows in place and let the new retention policy govern subsequent updates.
Operational checklist
- Back up the database and configuration file.
- Decide whether losing regular rollback is acceptable; if not, choose a positive limit.
- Add or edit
WP_POST_REVISIONSonly once in the activewp-config.php. - Place it near the start of the file, below the initial comment block.
- Preserve PHP syntax and test on staging where possible.
- Check for filters and post-type-specific hooks that override the global setting.
- Update a test post and confirm the editor, autosave recovery, and expected revision behavior.
- Treat old database rows as a separate, carefully verified maintenance task.
The Bottom Line
Use define( 'WP_POST_REVISIONS', false ); to disable regular WordPress revisions globally while leaving autosaves intact. If rollback is important, set a positive limit such as 3; use filters when different post types need different policies.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →




