define(’WP_POST_REVISIONS’, false);
Code language: Arduino (arduino)
DELETE FROM wp_posts WHERE post_type = “revision”;
Code language: SQL (Structured Query Language) (sql)
Now all post revisions related records should have been purged from your SQL database and all revision history should have been deleted. Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…
Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…
Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…
1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…
GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…
1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…
View Comments
After it you need to run [ OPTIMIZE TABLE "wp_posts" ].
Cause deleting lots of rows at a time, increase the overhead of table.
To see overhead of table
1. Login to phpMyAdmin
2. Select the affected database. Last column label with overhead'.
I want to warn you against your sql query which is not very clean :
you should use :
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';
if you want to delete all related datas.. and there are many of them !
use this request with ssh because it's a very long one..
Thanks for the advice. One thing to point out however. Your example only worked once I converted the smart quotes to straight quotes.
Cheers,