How to Restore Accidentally Deleted Content in WordPress

Last updated on Jun 11, 2025

Accidentally deleting content is not cool because writing it is not easy. Thankfully, WordPress has a built-in feature to address the issue. And this post will show you how to use it.

The feature is especially useful if you often write blog posts on your WordPress site although it also works on pages.

You can use the feature to restore accidentally deleted paragraphs, sentences or non-text content like images and buttons.

Let’s start this discussion by getting to know the feature first.

Shortcuts ⤵️

An Intro to Revision History in WordPress

If you often work with Google Docs or other web-based document editors, you must already be familiar with version history. A feature that allows you to check the editing history of a document.

WordPress also has the same feature that allows you to check the editing history of a blog post or page. With the feature, you can easily track the changes made to a blog post or page. Be it by the original author or by another user on your website.

revision history

The feature works when you hit the Save draft button or Publish button on a new document (page or post).

For an existing post (be it draft or published post), the feature works every time you click the Save button to apply your new changes.

What WordPress does when you hit one of those buttons is that it creates a new version of your document on the database. The version includes additional information like timestamps and authors.

Autosaves vs Revisions

Apart from revisions, WordPress also comes with an autosave feature.

What is the difference between revisions and autosaves?

By default, WordPress automatically saves the changes you made on a document via its editor (be it Gutenberg or Classic Editor) with the interval of 60 seconds.

In other words, as you are editing your blog post or page, WordPress automatically saves the changes you made every 60 seconds.

Unlike revisions which require a button click, autosaves work in the background as you are working.

Autosaves works on the current version of the document you are editing and you can only have one autosave at a time.

If you accidentally close your WordPress editor without saving the changes and re-open the editor, you will usually see the following message.

Autosave message

The above message is part of the autosaves feature in WordPress.

How to Enable Revision History in WordPress

Revision history is a great feature from the users’ perspective because it can be a life savior on a certain occasion.

For instance, you can use it to restore accidentally deleted content (e.g. a paragraph) so that you don’t need to re-write it, which can waste your time and energy if you do.

However, you need to understand that having too many post revisions is not good when it comes to site performance. Especially if you use a cheap, shared hosting service.

Again, every time you hit the Save button on the editor, WordPress will create a new version of your document. For every document version that WordPress creates, a new additional row is added to the database.

The more versions a document has, the more rows added to the database. The more rows added to the database, the larger the size of the database will be.

If you have a large website and make changes to the documents frequently, this can lead to unnecessary database bloat. This is why picking a hosting service that has a solid database configuration is super crucial.

And due to potential overload on the database caused by post revisions, many cheap hosting providers disable the revision history feature in WordPress.

Enabling Revision History in WordPress

If you use a shared hosting service and it disables the revision history feature, you can enable it yourself manually.

But how to know if revision history is disabled?

Easy enough. If you don’t see the number of revisions on the settings panel of the WordPress editor after you click the Save draft button, then your hosting provider disables it.

Number of revisions

To enable revision history in WordPress, you need to edit the wp-config.php file. You can find the file in the root directory of your WordPress installation (e.g. public_html).

wpf-config location

If your hosting provider has a built-in file manager feature, you can use it to edit the file.

Rocket.net and Rapyd Cloud are two examples of hosting providers that come with a built-in file manager feature.

Conversely, if your hosting provider has no file manager feature, you need to download the file first and then re-upload it after you edit it.

Which Part of the File That You Need to Edit?

The part of the wp-config.php file that you need to is the following line:

define('WP_POST_REVISIONS', false);

You can change the setting value from false to true. So, the line will look this:

define('WP_POST_REVISIONS', true);

If you can’t find the above line, you can add it manually. You can add it right before (above) the following line:

/* That's all, stop editing! Happy publishing. */
Adding a new line

Enabling Revision History on a Custom Post Type

Revision history is only enabled on the default post types by default (post and page). If you have a custom post type and want the revision history to be available on it too, you need to enable it yourself.

The method to enable revision history on a custom post type varied, depending on the plugin you use to create the custom post type. If you use ACF, you can enable revision history by simply ticking the Revisions option under the General tab on the Advanced Settings section.

Enabling revision on ACF

If you use Custom Post Type UI (aka CPT UI), you can find the Revisions option on the Settings block.

Enabling revisions on CPT UI

Limiting the Number of Revisions

As mentioned above, the more revisions/versions a post has, the more rows added to the database, which will affect the database size.

If your hosting service has limited resources, this can lead to a problem over time.

To save your hosting resources, you can limit the number of revisions per post. To do so, you can edit the above line and replace the true value with a number according to the number of the revisions you want to have on each post.

For instance, if you want each post to have the maximum of 5 revisions, then the line should look like this:

define('WP_POST_REVISIONS', 5);

In the example above, WordPress will save only the most recent five revisions of each document (post or page).

Using Revision History to Restore Deleted Content

After making sure that revision history is enabled on your WordPress website, you can start to use it to restore the content you accidentally deleted. You can do that by simply reverting to the latest version before you edit it.

First, open the document (post or page) where you want to restore the deleted content of and click the number on the Revisions field.

Number of revisions

You will be taken to the Compare Revisions screen where you can compare between versions of your document. The screen highlights the differences between versions. Additions are marked in green, while removal are marked in red.

Removals and additions

As you can see, you can compare the revisions side by side, making it easy to spot changes. The left column is the version of the previous revision, while the right is the version of the selected revision.

You can use the slider to switch between versions.

Once you find the version of your document before you accidentally deleted the content of, you can click the Restore This Revision button and WordPress will bring it into the editor.

Restore this revision

That’s it. You can now edit the version of your document before you accidentally deleted the content of.

Summary

WordPress has a revision history feature. While most users already know it, not all of them really understand what it is used for.

The revision history of WordPress allows you to track the changes made to a document. Be it a post or page. You can compare two versions of your document side by side.

There are some occasions where the existence of revision history is super crucial. One of which is when you are attempting to restore accidentally deleted content of a document as I have elaborated above.

Revision history is enabled by default, but some hosting providers may disable it. Especially cheap shared hosting providers with limited resources.

That is why I don’t recommend you to use a cheap hosting service, which usually has more limited resources, for a professional WordPress website.

This page may contain affiliate links, which help support the project. Read our affiliate disclosure.

Aliko Sunawang

Aliko is a professional blogger and web creator. He has been blogging with WordPress since 2013. In his spare time, he loves going out to take some photos. More

Need new hosting?

Get a 10% discount on Cloudways for 3 months.

suggested posts

Cloudways

Cloudways Review: Excellent Performance

The main takeaway from my exploration is that Cloudways is a great solution if you have a growing website…

Dollar

How to Build MRR with Your WordPress Blog

If you have a WordPress blog, you can turn it into a monthly money-printing machine by simply…

Switch to Cloudways and enjoy the traffic spike 🚀

Your website deserves a better place to grow. Get a 10% discount for 3 months.

Where should we send the template?

Thanks! Please check your inbox.