Black Friday • Black Friday •
Revisions Αναθεωρήσεις

How to remove Post Revisions in WordPress

5/5 - (4 votes)
Revisions Αναθεωρήσεις

Occasionally reviewing a post on your site is not a time consuming task. However, over time, revisions begin to add up and can eventually take up significant space in your database.

Whether you are trying to free up some space you need or to completely prevent the issue, disabling or removing old post revisions from your WordPress site is an available option.

Σε αυτό το άρθρο θα συζητήσουμε τι είναι οι αναθεωρήσεις αναρτήσεων – revisions και πώς μπορούν να χρησιμοποιηθούν. Θα σας εξηγήσουμε γιατί θέλετε να τα απενεργοποιήσετε, να τα περιορίσετε ή να τα καταργήσετε και θα σας καθοδηγήσουμε πώς να το κάνετε καθένα. Ας Ξεκινήσουμε!

What is post revisions?

Revisions, sometimes referred to as revisions, are a built-in feature of WordPress. They are useful because they make it easy to get back to a previous version of a post you made.

For example, suppose you decide to delete certain paragraphs in your post. However, later on, you realize that the editing was wrong and you want to recover the information you removed. With post reviews, you can easily do this.

In WordPress Gutenberg, this feature is located on the right side of the navigation under Document> Revisions:

Αναθεωρήσεις-editor revisions

If you are still using Classic Editor, you can find the reviews in the Publish box, also in the right-hand navigation menu:

Αναθεωρήσεις-editor-revisions

If you are still using Classic Editor, you can find the revisions in the Publish box, also in the right-hand navigation menu:

With the WordPress review system, every update is recorded and stored in the database. While the option of viewing the changes made to a post and restoring previous versions can be extremely useful but it takes up a lot of space.

The more revisions you make, the bigger your database can become. Database optimization is an important part of maintaining a WordPress site. Removing old revisions, for example, can reduce the size of your backups.

There are three main options to choose from when managing post-revisions. You can turn them off completely, restrict them, and remove old post revisions.

How to turn off post revisions in WordPress

One way to prevent the accumulation of revisions in your WordPress database is to remove the opportunity to do so from the beginning.

To permanently disable post-revisions, locate the file wp-config.php of your WordPress site listed. Add the following line of code to the top:

define( ‘WP_POST_REVISIONS’, false );

This barcode deactivates saving post revisions to your database in the future. If you want to enable this option at some point in the future, just replace the bar with:

define (‘WP_POST_REVISIONS’, true);

When you're done, make sure you save your changes before you leave.

How to Restrict Post Revisions in WordPress

Εάν είστε σαν τους περισσότερους ανθρώπους, θα θέλετε να αποθηκεύσετε μερικές αναθεωρήσεις αναρτήσεων για κάθε ανάρτηση που προσθέτετε στον ιστότοπό σας – για να είστε ασφαλείς. Για αυτό, η καλύτερη επιλογή είναι να ορίσετε ένα όριο στον αριθμό των αναθεωρήσεων αναρτήσεων που αποθηκεύονται στη βάση δεδομένων σας.

You can do this by adding the following line to the file wp-config.php:

define(‘WP_POST_REVISIONS’, 3);

This line saves the three most recent post revisions instead of all of them, which means that older ones are automatically deleted as soon as newer versions are saved. You can replace the number three with another integer according to your preferences.

Instead of limiting post revisions to a predefined number, you can also increase the auto-save interval to save fewer revisions. Add the following line at the top:

define( ‘AUTOSAVE_INTERVAL’, 600 );

By default, WordPress automatically saves reviews of your posts every minute (60 seconds). However, adding this line will save every 10 minutes (600 seconds).

If you avoid encoding or adding code to your site wp-config.php file, you can always use the plugin, such as WP Revisions Control. After installing and activating this plugin, you can configure the number of allowed post revision revisions by going to Settings> Write:

WP revisions control

It is important to understand that the techniques we have covered so far disable or limit the storage of post reviews for future posts.

How to Remove Old Post Reviews in WordPress (2 Methods)

In this section, we'll cover the two methods you can use to permanently remove old post revisions from your WordPress site database. If you are familiar with SQL, you can follow the first method. However, if you prefer to use a PLUGIN, go ahead and go to the second method.

Method 1: Delete revisions after using code

Deleting post revisions from your database is one of those things you should be able to do without having to install an add-on.

Για να διαγράψετε όλες τις προηγούμενες αναθεωρήσεις αναρτήσεών σας από τη βάση δεδομένων του ιστότοπού σας, συνδεθείτε στο cPanel του λογαριασμού φιλοξενίας του ιστότοπου WordPress και κάντε κλικ στο εικονίδιο phpMyAdmin.

In the left navigation panel, find and click on your WordPress database. Click the SQL tab:

phpmyadmin

You will be taken to the phpMyAdmin SQL interface. Then where you can run an SQL query. You can do this by entering the following code snippet:

DELETE FROM wp_posts WHERE post_type = “revision”;

Be sure to replace wp_ with your own WordPress database prefix. Then click the Go button. This will start the command:

Revisions SQL

Αυτό το ερώτημα SQL καταργεί όλες τις αναρτήσεις από τη βάση δεδομένων σας που έχουν post_type = “revision”. Ίσως θέλετε να δημιουργήσετε ένα αντίγραφο ασφαλείας της βάσης δεδομένων σας πριν από την εκτέλεση αυτού του ερωτήματος ως πρόσθετο μέτρο ασφαλείας.

Method 2: Use a WordPress plugin to delete old revisions

Although deleting post revisions from your WordPress site can be accomplished by running a single SQL query, it may be easier for you to install a plugin and let it do all the work. This may be due to the fact that the plugin has additional benefits (database maintenance, removes redundant files, etc.) or simply because you are not comfortable with programming.

One plugin you can think of and use is WP-Optimize:

WP Optimize Plugin

Although this plugin offers a premium version with advanced features, you can download it and use it to delete old revisions for free. WP-Optimize is an all-in-one plugin you can use to optimize your WordPress database.

Once you have installed and activated the plugin, it will add a WP-Optimize menu item to the WordPress control panel. To delete publication reviews, you can go to WP-Optimize> Database.

Στην περιοχή Βελτιστοποιήσεις , μπορείτε να επιλέξετε το πλαίσιο δίπλα στην επιλογή “Εκκαθάριση όλων των αναθεωρήσεων ανάρτησης” και, στη συνέχεια, κάντε κλικ στο κουμπί Εκτέλεση βελτιστοποίησης :

Database Optimizations

You can delete the plugin or disable it once you have completed this process.