wp_postmeta 数据表是WordPress中存储文章附带信息的,除了一些特定的情况下,里面的数据是没有用的,下面在给出几条语句让你的 wp_postmeta 表变得干净。操作之前请先备份数据库。然后执行下面的SQL语句清理和优化 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 = '_wp_old_slug';
DELETE FROM wp_postmeta WHERE meta_key = '_revision-control';
DELETE FROM wp_postmeta WHERE meta_value = '{{unknown}}';

这五条语句执行完毕能够删除掉95%以上的数据,算的上是极限优化了。通过上面对 wp_postmeta 数据表的优化和清理,我们的数据库瘦身不少,执行效率也有所提升。

实际只使用前四条 最后一条为保险起见 不用

The wp_postmeta data table is used to sTore the information attached to the article in WordPress. The data in it is useless except in some specific cases. Here are a few sentences to make your wp_postmeta table clean. Please back up the database before proceeding. Then execute the following SQL statement to clean up and optimize the junk files and cache in the wp_postmeta data table. The following two statements test that safe deletion is not dangerous.

DELETE FROM wp_postmeta WHERE meta_key ='_edit_lock';
DELETE FROM wp_postmeta WHERE meta_key ='_edit_last';

The following are three newly tried sentences, the first two are not very dangerous. The last one is not clear about the current role, but there is no abnormality after deletion.

DELETE FROM wp_postmeta WHERE meta_key ='_wp_old_slug';
DELETE FROM wp_postmeta WHERE meta_key ='_revision-control';
DELETE FROM wp_postmeta WHERE meta_value ='{{unknown}}';

After these five statements are executed, more than 95% of the data can be deleted, which is a limit optimization. Through the above optimization and cleaning of the wp_postmeta data table, our database has been slimmed down a lot, and the execution efficiency has also been improved.

Actually only use the first four and the last one is for insurance purposes.

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。