• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Limit Post Revisions In WordPress Without a Plugin

Bhagwad Park

Published on: April 4, 2022

Categories: WordPress 0

In an earlier article, I’d talked about some WordPress maintenance tasks that you should do regularly. One of them was limiting the number of post revisions that WordPress saves by default. However, in that article, I’d mentioned a plugin you could use that did several different maintenance tasks at once from the same interface. But if you just want to know how to limit the number of post revisions in WordPress without a plugin, this tutorial is for you!

WordPress Saves Unlimited Revisions by Default

Whenever you make a change and save either a published post or a draft, WordPress saves a copy of the revision in its database, enabling you to revert to it whenever you want. Here’s a screenshot showing 10 post revisions that I made to a test post:

Unlimited Post Revisions in WordPress
Unlimited Post Revisions in WordPress

This number increases without limit as time goes by, and you can imagine that if you have lots of posts on your site, the sheer weight of the revisions will keep piling up. I don’t think they take up too much storage space, but why have the remnants of posts long gone? It creates unnecessary rows on in your tables, and it smacks of poor housekeeping.

Instead, what we want to do, is to put a limit on this useful feature – we don’t want to disable it entirely. I find a limit of 3 to be pretty good. But you can go ahead and set it higher – to maybe 10 if you want. Anything as long as it’s not infinite!

Here’s how we can limit the number of post revisions that WordPress saves by default.

Updating the wp-config.php File

In the root directory of your blog, there’s a very important file called “wp-config.php”. This is where all the access information for your site’s databases is stored, and it’s also where WordPress keeps a lot of important configuration data. We can modify this file to include a special variable that instructs WordPress to keep a specific number of post revisions. The name of the variable is:

WP_POST_REVISIONS

To open wp-config.php, go to your web hosting’s admin panel (usually cPanel), and open the file manager. Now navigate to the WordPress home directory, locate wp-config.php and open it. But before you make any changes, be sure to take a backup if this is your first time editing the wp-config.php file. It’s a very delicate file, and you can completely hose your WordPress site if you’re not careful!

There, you insert the following line:

define( ‘WP_POST_REVISIONS’, 3 );

Here’s a screenshot of where you can place it:

Adding a Line to wp-config.php to Limit Post Revisions
Adding a Line to wp-config.php to Limit Post Revisions

Make sure you put this line above the line which says “That’s all, stop editing! Happy blogging”. Don’t forget to include the semi-colon at the end of the statement. Save your changes, and you’re done!

Verifying that the Post Revisions Limitation is Working

Once you’ve made the change above, go to any post and save your changes. The changes for each post won’t take effect until you’ve tried to save it at least once. But as soon as you click the “save” or “update” button, the number of post revisions will be restricted to the number you set in wp-config.php. Here’s a screenshot showing that I now have only 3 post revisions as opposed to 10 from the same post I showed earlier:

Limiting Post Revisions in WordPress

And that’s it! With a simple line change, you’ve implemented a site-wide policy of limiting WordPress post revisions without needing to install a plugin. It’s a neat solution that works very nicely. I hope you found this useful!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

Joomla vs. WordPress: Which One Is Better?

In this post, we’ll consider five differences between Joomla and WordPress and how you might go forward with setting up a WordPress website.

How To Back Up Your WordPress Site (And Why You Should Do It Today)

In this post, we’ll take a closer look at why backups matter. We’ll also show you different ways to back up your WordPress website.

How To Start A Newsletter In WordPress

Check out our complete guide on why and how you should start your own newsletter in WordPress.

How to Eliminate Render-Blocking Resources in WordPress (& Why You Should)

Many things can slow down your site, including render-blocking resources. These are CSS and JavaScript files that delay the loading of content on your site. As a result, visitors will have to wait longer to interact with your page, which could lead to frustration and instant exits.  So, what can you do to eliminate render-blocking […]

Reader Interactions

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA