Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk8 min

How to Disable Post Revisions in WordPress (Safely)

Learn how to disable regular WordPress post revisions safely, keep autosaves, set a revision limit, use post-type filters, and handle existing database rows.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To disable regular post revisions in WordPress, add define( 'WP_POST_REVISIONS', false ); to wp-config.php before WordPress loads its configuration. The setting stops WordPress from retaining normal revision history, but it does not turn off autosaves. If you need database control without giving up rollback, use a positive limit such as 3 instead.

Choose the policy first, then edit a backed-up or staging copy of the configuration file. A placement mistake, invalid PHP, or an unnecessarily aggressive cleanup can make a site harder to recover, so the safest approach is to change retention behavior first and treat removal of old database rows as a separate task.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What WP_POST_REVISIONS controls

WordPress stores a history of changes to posts and other revision-enabled content. That history lets an editor compare earlier versions and roll back after an unwanted edit. The global configuration constant is WP_POST_REVISIONS. When it is not defined, WordPress keeps revisions by default; the official developer documentation describes that default as an unlimited number of revisions.

The constant controls regular revisions and their retention policy. It is not a master switch for every background save made by WordPress. Autosaves are a separate mechanism: they do not overwrite published content and remain available as a recovery copy. Disabling regular revisions therefore reduces ordinary history without removing that safety mechanism.

Value meanings at a glance

Value Regular revision behavior Autosave behavior Practical result
true or -1 Stores every revision Autosaves continue Maximum rollback history and potentially the most database growth
false or 0 Stores no regular revisions One autosave per post remains Smallest normal revision footprint, with autosave recovery still available
Positive integer, such as 3 Retains that many revisions per post; older ones are deleted after a later update One autosave per user is retained in addition to the stated revision count Bounded history with a defined rollback window

These are behavior definitions, not storage guarantees measured across every hosting environment. The actual number of rows in a database also depends on the content being edited and on other WordPress data.

Decide whether disabling is really the right policy

Disabling revisions is appropriate when the site has a deliberate reason to keep no normal revision history—for example, when database growth must be tightly bounded and editors have another review or backup process. It removes the convenient ability to restore an earlier saved version through the normal revision interface.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A cap is often the safer compromise. With define( 'WP_POST_REVISIONS', 3 );, editors retain three revisions for each post while older revisions are automatically pruned when the post is updated again. That limits accumulation without making every accidental edit irreversible.

Compare the two approaches

Decision axis Disable with false or 0 Limit with a positive integer
Recovery capability No regular revision history; the autosave recovery copy remains Rollback remains available within the chosen number of revisions
Database growth Stops new regular revision rows from accumulating Bounds regular history rather than eliminating it
Configuration complexity One global constant One global constant, or a filter for conditional rules
Scope Global behavior for the installation Global cap unless a filter applies different limits
Best fit A policy that intentionally gives up normal rollback Sites that want predictable storage and a recovery window

Prepare before editing wp-config.php

wp-config.php is a PHP configuration file loaded early in the WordPress request. A syntax error or misplaced code can prevent the site from loading, so preparation matters more than the short code change suggests.

  • Make a backup of the current wp-config.php before changing it. Keep the original available for restoration.
  • When possible, make and test the change on a staging copy first rather than on the live site.
  • Use a plain-text editor that preserves PHP characters and does not add formatting or smart quotation marks.
  • Decide whether the site needs a global policy or a conditional policy before adding code. A filter is more appropriate when different post types need different limits.
  • Keep the setting in one clearly identifiable place. Multiple definitions make troubleshooting harder and can leave the effective value unclear.

The WordPress configuration handbook specifically notes that some installations require the constant near the beginning of wp-config.php, immediately below the initial comment block. Place the definition before the part of the file that loads WordPress, and preserve the surrounding PHP syntax.

Disable regular revisions globally

Use this exact definition when the policy is to keep no regular revisions:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
define( 'WP_POST_REVISIONS', false );
  1. Open a backup or staging copy of wp-config.php.
  2. Find the early configuration section, immediately beneath the file’s initial comment block or another location before WordPress loads its configuration.
  3. Insert the definition exactly as shown. The semicolon is required, and the value is the PHP boolean false, not a quoted word such as 'false'.
  4. Save the file without changing the rest of its PHP syntax.
  5. Deploy the edited file to the intended environment only after checking the file and retaining the backup.
  6. Create or edit a test post, save it more than once, and inspect the editor’s revision behavior. The expected policy is that normal revisions are not retained, while autosave recovery remains a separate mechanism.

Do not place the line after a PHP closing tag, inside a comment, or inside another statement. If the file has no closing tag, leave that convention unchanged rather than adding one merely for this setting.

Use a bounded number instead of disabling history

To retain a defined amount of rollback history, replace false with a positive integer. For example:

define( 'WP_POST_REVISIONS', 3 );

The number means three revisions per post. When the post is updated again, older revisions beyond that limit are automatically deleted. The limit applies to regular revisions; the autosave mechanism continues separately, and the documentation specifies one autosave per user in addition to the positive revision count.

How to choose a limit

There is no universal number that suits every editorial workflow. A small team making short, frequent edits may need only a few rollback points. A site with legal, technical, or multi-author review may need a larger window. Choose a number by asking how far back an editor realistically needs to recover, then test that workflow in staging.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use 1 or 2 when: storage control is important and editors usually notice mistakes immediately.
  • Use 3 or another small single-digit value when: you want a practical safety net without retaining a long edit history.
  • Use a larger positive value when: posts pass through several review rounds and rollback several saves back is a normal requirement.
  • Use false or 0 only when: the loss of normal revision history is an intentional policy, not merely an attempt to reduce database size.

A positive integer is still a global setting when defined in wp-config.php. It does not automatically give one post type a different limit from another; use a filter for that.

Apply different limits with filters

Conditional policies use the wp_revisions_to_keep filter. It receives the current number of revisions and the WP_Post object. The number returned by the callback becomes the retention value for that post.

add_filter( 'wp_revisions_to_keep', function ( $num, $post ) {
    if ( 'page' === $post->post_type ) {
        return 5;
    }
    return $num;
}, 10, 2 );

In this example, pages are assigned a limit of five, while other post types keep the value that was already in effect. The callback accepts two arguments, so the final parameter 2 is important. Keep the code in a location that loads reliably for the site, and test it on staging before applying it to production.

Post-type-specific hooks

WordPress also exposes dynamic post-type filters such as wp_post_revisions_to_keep or wp_page_revisions_to_keep. The post-type-specific hook overrides both the global WP_POST_REVISIONS constant and the general wp_revisions_to_keep filter. That precedence matters when a broad setting appears correct but one content type behaves differently.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a post-type-specific hook only when that narrower scope is intentional. Otherwise, a single global constant is easier to understand and maintain.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify that the setting is taking effect

A successful file save is not proof that WordPress is using the intended value. Verify both the file and the resulting behavior.

  1. Reopen the deployed wp-config.php and confirm the definition exists exactly once.
  2. Check that the value is unquoted false, 0, or a positive integer. A string that merely looks like a boolean can produce a different PHP value.
  3. Confirm the line appears before WordPress loads its configuration and, if necessary, move it near the start of the file beneath the initial comment block.
  4. Review any loaded filter code. A post-type-specific filter can override both the constant and the general filter.
  5. Use a non-critical test post. Save it repeatedly, then check whether regular revision entries are retained according to the selected policy.
  6. Check recovery expectations separately: disabling regular revisions should not be interpreted as disabling autosave.

If revisions still appear

  • Placement: The definition may be too late in the file. Move it to the early configuration area described above.
  • Override: A general or post-type-specific filter may return a different number. Remember that the narrower post-type hook has precedence.
  • Wrong file: The edited copy may not be the configuration file used by the deployed installation. Compare the staging and production paths and deployment process.
  • Expectation: Changing the setting governs future saving and pruning. It does not automatically remove historical rows already stored in the database.
  • Testing method: Autosaves are separate from regular revisions. Seeing an autosave recovery copy does not prove that normal revisions are being retained.

If the site shows a PHP error after the change

Restore the backed-up configuration file first so the site can load, then reapply the change carefully on staging. Check for missing semicolons, altered quotation marks, an incomplete surrounding statement, or code inserted inside a comment. Do not keep editing a live configuration file blindly when the site is unavailable.

Understand what happens to existing revisions

The constant and filters govern future saving and pruning behavior. They are not a universal command to erase every revision row already present. If you change from unlimited history to false, old rows may still exist until a separate cleanup is performed; the setting alone should not be described as a database purge.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Removing existing rows is a different operational task that requires a carefully verified procedure for the particular installation, backup, database access method, and content model. The available official material does not establish one universally safe current cleanup procedure. Avoid copying ad-hoc SQL into production on the assumption that it is harmless. Preserve a restorable backup and obtain an installation-specific, tested process before attempting historical deletion.

Operational checklist

  • Define the goal: eliminate regular history or cap it.
  • Choose false/0 for no regular revisions, or a positive integer for bounded rollback.
  • Back up wp-config.php and use staging when available.
  • Place the constant early, near the beginning of the file beneath the initial comment block, before WordPress loads its configuration.
  • Preserve valid PHP syntax and avoid duplicate definitions.
  • Check for general and post-type-specific filters that can override the value.
  • Test repeated saves on a non-critical post.
  • Explain the policy to editors so they know whether normal rollback is available.
  • Treat existing database rows as a separate cleanup decision, not an automatic consequence of changing the constant.

Which configuration should you use?

Use false when the organization has consciously accepted that normal revision rollback is unavailable and wants the smallest regular revision footprint. Use a positive integer when editors still need a defined recovery window. Use filters when the answer depends on the post type or on a condition represented by the WP_Post object.

Whatever policy you choose, keep autosave expectations separate from revision expectations. Autosaves remain a recovery copy and do not overwrite published content, but they are not the same as a browsable history of every saved revision. That distinction should be part of the site’s editing and recovery documentation.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.