First of all, the optimization described in this article refers to non-plug-in optimization. In addition, the operation of the database has certain risks and unpredictability. Therefore, before the next operation, Good VPS reminds you: Back up the database to avoid unexpected events!
First of all, the following items all require running MySQL statements in the database. Please log in to the database management page (such as using phpMyAdmin), enter the wordpress data table, and select SQL.
***Clean up and automatically save drafts, historical versions, and recycle bin***
DELETE FROM wp_posts WHERE post_status!=’publish’ OR post_type=’revision’;
***Clean up post tags that are still left after deleting files***
DELETE FROM wp_postmeta WHERE post_id NOT IN(SELECT ID FROM wp_posts);
***Clean wp-commentmeta table***
TRUNCATE TABLE `wp_commentmeta`
***Clean wp_postmeta***
DELETE FROM wp_postmeta WHERE meta_key = ‘_edit_lock’;
DELETE FROM wp_postmeta WHERE meta_key = ‘_edit_last’;
DELETE FROM wp_postmeta WHERE meta_key = ‘_revision-control’;
Okay, after the above operations, a considerable part of the garbage in your wordpress has been cleaned up. Of course, this is just a small optimization. You can also use plug-ins to do wordpress optimization work.
【Note】The above are all tested and passed by the "Good VPS Tribe".