Deleting or Closing WordPress Post Versions

WordPress There's a feature called post versions. When you make changes to a published post, it keeps a separate record of the previous version. However, this can sometimes be frustrating and harmful. For example, if you make 10 changes to a post, there will be 10 older versions. As your site grows, this will cause your database to bloat and slow down. Therefore, here I'll show you how to delete, disable, and limit these versions.

Disabling WordPress Post Versions

WordPress to turn off post versions wp-config.php Simply place the following code in your file. This code will be: <?php And ?> Don't forget to add a blank line between the tags.

define('WP_POST_REVISIONS', false);

Limiting WordPress Post Versions

WordPress to set limits on article versions wp-config.php Simply place the following code in your file. You can specify the number of files as you wish. The limit here is the latest three versions.

define('WP_POST_REVISIONS', 3);

Deleting WordPress Post Versions

WordPress There's a simple way to purge your post versions from the database. While most places use plugins to do this, I don't think it's a good idea. WordPress It is most logical to use it with minimal add-ons.

It requires the following sql query phpMyAdmin Run it on your computer or use other methods, it doesn't matter. Text versions will be deleted.

DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision'
0 0 votes
Article Rating
Subscribe
Notify of
guest

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

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments