Discover in this tutorial how to prevent WordPress page and post revisions from being automatically saved using a code snippet.
WordPress has an auto-saving system that is great for avoiding scares. However, each revision takes up the same space as the article.
Therefore, if you have 20 revisions of each post you are increasing the size of the WordPress database considerably, which eventually slows down the loading speed of the web.
You’ve already seen how to limit the number of revisions to prevent the database from getting bigger than it should be.
But you also have the option to disable the revision saving option altogether.
Here you can see how to do it with one line of code:
Snippet to avoid saving WordPress revisions
Add the following fragment somewhere before the line containing “require_once(ABSPATH….” in the wp-config .php file:
It’s that simple,
From now on, only the latest version of your website’s entries and pages will be saved.
As you can see, with one line of code you can prevent revisions of posts and pages from being automatically saved in WordPress.
It’s a simple and practical trick to keep the size of the database at bay and keep it better optimized.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉