WordPress: Delete revisions without timeout

If you run a website with WordPress, you will surely know what the revisions are. Revisions or revisions are cached data that is stored while you are preparing a post. So if you have the revisions enabled, you should delete the stored data every two weeks, as they are not necessary and add "weight" to your database. wordpress

The is that if at some point you forget to delete them, so many will accumulate that the plugins that exist (Better Delete Revision) for them, they will be timed out.

The article is addressed to those who do not host their website at wordpress.com, and have access to SQL.

If you search Google for a solution, there is a simple SQL statement, but you should not use it in your WordPress installation. The command will delete the revisions, but will leave all metadata in your database.

Do not use this command:

DELETE FROM wp_posts WHERE post_type = "revision";

Before you start, get a backup of your database.

Then go to the SQL execution box και κάντε αντιγραφή (ctrl+C) – επικόλληση (ctrl+V) την παρακάτω εντολή:

DELETE a, b, c FROM wp_posts and 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'

Run the command from GO.

rev-iguru

If you want to disable all revisions, you can add the following code at the bottom of it y wp_config.php in / of WordPress.

define ('WP_POST_REVISIONS', false);

rev1

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.082 registrants.

Written by giorgos

George still wonders what he's doing here ...

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).