WordPress清理 wp_postmeta 数据表全攻略

前端之家收集整理的这篇文章主要介绍了WordPress清理 wp_postmeta 数据表全攻略前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

wp_postMeta 数据表是wordpress中存储文章附带信息的,除了一些特定的情况下,里面的数据是没有用的,下面在给出几条语句让你的 wp_postMeta 表变得干净。

数据库。然后执行下面的sql语句清理和优化 wp_postMeta 数据表中的垃圾文件和缓存。

下面两条语句测试安全删除无危险。

Crayon-5c891c946a67e403900980" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">Shell
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891c946a67e403900980-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891c946a67e403900980-2">2
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891c946a67e403900980-1">Crayon-e">DELETE Crayon-e">FROM Crayon-e">wp_postMeta Crayon-e">WHERE Crayon-v">Meta_keyCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'_edit_lock'Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891c946a67e403900980-2">Crayon-e">DELETE Crayon-e">FROM Crayon-e">wp_postMeta Crayon-e">WHERE Crayon-v">Meta_keyCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'_edit_last'Crayon-sy">;

以下是新尝试的三条语句,前两条危险性不大。最后一条不太清楚目前作用,但是删除后无任何异常。

Crayon-5c891c946a686503502251" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">Shell
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891c946a686503502251-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891c946a686503502251-2">2
Crayon-num" data-line="Crayon-5c891c946a686503502251-3">3
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891c946a686503502251-1">Crayon-e">DELETE Crayon-e">FROM Crayon-e">wp_postMeta Crayon-e">WHERE Crayon-v">Meta_keyCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'_wp_old_slug'Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891c946a686503502251-2">Crayon-e">DELETE Crayon-e">FROM Crayon-e">wp_postMeta Crayon-e">WHERE Crayon-v">Meta_keyCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'_revision-control'Crayon-sy">;
Crayon-line" id="Crayon-5c891c946a686503502251-3">Crayon-e">DELETE Crayon-e">FROM Crayon-e">wp_postMeta Crayon-e">WHERE Crayon-v">Meta_valueCrayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'{{unknown}}'Crayon-sy">;

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

原文链接:https://www.f2er.com/wordpress/238329.html

猜你在找的wordpress相关文章