WordPress offers a fantastic feature to save the draft of your blog posts and pages; it helps you from losing your precious content.
Every time you save a post, the database stores its copy. But the problem occurs when you have many copies of the same post/page. As you know, a database plays a vital role in the page loading time of a WordPress website; you must keep it optimized.
Many people might have more than five copies of a single blog post in their site's database, which directly increases its size and slows down the speed.
To maintain a healthy site, you can either choose to limit or disable the post revisions. When you have multiple authors, the post revision can lead to a poor page loading time.
In this tutorial, I am going to walk you through a simple process to disable or limit post revisions using the wp-config.php file.
Learn to Limit Post Revisions Using cPanel
First of all, if you're the sole author of your site, you might want to limit the post revisions instead of disabling them.
WordPress allows you to keep unlimited numbers of revisions of the same blog post or page; you can limit them to three, which is a convenient number.
As always, you require the understanding of cPanel and the wp-config.php file. You may already have read about such a file; it's one of the most vital files for a WordPress site.
I hope you know how to edit wp-config.php. If not, let me show you the guide.
Follow the process.
Open your cPanel account and start looking for the file manager icon, because that's where all the data of your WordPress website is available.
The layout of cPanel may vary, depending on the web hosting company you have. Bluehost offers a blue layout, Hostinger maintains a purple color, Siteground also uses a different design theme.
Don't you worry about anything, you can easily find the file manager. Click to open.
On this new tab in the browser, you can see many files and folder. But you need to make sure; you're in the root directory.
By default, cPanel may show you the home directory. Navigate to public_html from the left-hand sidebar. Click to open.
Now you see the core files of your WordPress site. You can easily find the wp-config.php file. Right-click to edit.
As usual, you can also use the standard Edit option shown on the cPanel navigation menu. And if you're hosting multiple websites on the same web hosting, you have to open the root directory of the domain you want to edit.
Mostly, the WordPress installation resides inside the folder name of the domain you have.
A popup appears to ask to disable encoding. Just, click on the Edit button a new tab opens up in the browser.
You can see lots of coding lines. Don't be afraid, all you need is to copy the code and paste inside the wp-config.php file.
Click on Save Changes. From now onwards, WordPress keeps only three recent drafts of your blog posts.
How to Disable Post Revisions
Sometimes, when the size of a database increases so much, you may in need to disable post revisions. When having a big website with thousands of posts, you can imagine the size of a database having three revisions.
Disabling post revisions can help you maintain a fast website. There is nothing different about such a task. You have to follow the exact steps as mentioned above.
But the code you have to add is a little bit different. Instead of a number, you have to fill in "false."
Let me show you the code.
Save the file, and you're good to go.
Depending on your requirements, you can choose either. Congrats, you have successfully learned to limit and disable page and post revisions of your WordPress site.
I Hope You Can Take the Perfect Decision to have a Fast Loading Website
Most of the WordPress users ignore the database optimization and how it affects the website's page loading time. Pages and posts revisions can put a significant impact on a website's speed.
I remember when I encountered with a poor page loading time because of post revisions. I checked the database, and there're so many copies of the blog posts.
I suggest you limit the number to three.
WordPress has some exciting features to offer. But sometimes, people don't understand the concept and blame the platform.
Adding a one-line code solves all the problems and helps you maintain a fast loading WordPress site. I hope you can accomplish such a task with no difficulty.