Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

WordPress Post Revisions Limit: Default, Caps and Autosaves

By default, WordPress has no post revisions limit: it stores every revision of a post. You can cap it by setting WP_POST_REVISIONS in wp-config.php, for example define( 'WP_POST_REVISIONS', 3 ), or with the wp_revisions_to_keep filter. A value of false or 0 stores no revisions, and old ones are deleted automatically on the next update.

Out of the box, there isn't a limit. WordPress keeps a record of each saved draft and published update for as long as the post exists. On a site with long posts edited many times, that history adds up, which is why people go looking for the setting.

How WP_POST_REVISIONS values behave

SettingWhat WordPress keepsApplies to
true (the default) or -1Every revisionWP_POST_REVISIONS
false or 0No revisions, except the one autosave per postWP_POST_REVISIONS
Any integer above 0That many revisions per post, plus one autosave per userWP_POST_REVISIONS
AutosavesOne for each user, per postAll posts and pages
Per-post overrideWhatever the wp_revisions_to_keep filter returnsDevelopers

Setting a cap in wp-config.php

The constant goes in your site's wp-config.php file. WordPress's documentation gives this line as its example:

define( 'WP_POST_REVISIONS', 3 );

The 3 is only an example: put in whatever number suits how your team works. Add the line, save the file, and the new limit applies from then on. Because wp-config.php controls the whole site, take a copy before you edit it, or ask whoever manages your hosting to make the change.

What happens when a post hits its cap

Old revisions are deleted automatically when the post is updated again. So if you set a cap on a site that already has a long history, nothing changes the moment you save wp-config.php. The trimming happens post by post, the next time each one is updated. If you set the value to false or 0, WordPress stops storing revisions, apart from the single autosave per post.

The per-post filter for developers

The wp_revisions_to_keep filter lets developers change how many revisions are kept for a given post. That's useful when one type of content needs a longer history than the rest, for example pages a legal or compliance team edits, while blog posts keep a short one. It's code, so it belongs in a plugin or theme your developer maintains.

Autosaves don't pile up

A common worry is that autosaves fill the database. They don't. There's only ever a maximum of one autosave per user for any given post, and new autosaves overwrite old ones, so the tables don't grow by a row every 60 seconds. Autosaves don't overwrite published content either. They're stored as a special type of revision, marked with an Autosave label.

No dashboard button for deleting revisions

WordPress.org Documentation is clear on the limitation. The default is no limit at all, and WordPress has no interface for deleting revisions, only an API function. Capping is done in wp-config.php or by a developer filter. And whatever limit you set, it doesn't touch autosaves: one per user per post always remains.

Where revisions live, and what they track

Revisions are stored in the posts table as children of the post, with post_status set to inherit and post_type set to revision. By default WordPress tracks changes to the title, author, content and excerpt. That's enough to restore an earlier version of the words, which is what most editors use revisions for.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

How Notion handles page history

Notion takes a timed approach to version history: it records a new version of a page every 10 minutes while you actively edit it, and another two minutes after your last edit. For more on running a WordPress site well, my list of WordPress plugins worth installing and my guide to WordPress design and development for beginners cover the wider setup.

My advice before you change the setting

Decide whether you want a cap at all. Unlimited revisions are the default for a reason: they let you roll back any edit. If you do want one, set WP_POST_REVISIONS to a number your team is comfortable with, back up wp-config.php first, and remember the trimming happens the next time each post is updated. Leave autosaves alone; WordPress already keeps them to one per user per post.

Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.

Frequently asked questions

What is the default WordPress revision limit?

There's none by default: true or -1 stores every revision.

How do I limit revisions?

Add define( 'WP_POST_REVISIONS', 3 ); to wp-config.php, with your own number in place of 3.

How do I turn revisions off?

Set WP_POST_REVISIONS to false or 0; one autosave per post is still kept.

Do autosaves fill up my database?

No. There's a maximum of one autosave per user per post, and new ones overwrite old ones.

Can I delete revisions in the dashboard?

WordPress documents an API function but no UI for deleting revisions.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.