{"id":3910,"date":"2019-12-12T09:02:43","date_gmt":"2019-12-12T01:02:43","guid":{"rendered":"https:\/\/blog.naibabiji.com\/?p=3910"},"modified":"2019-12-12T21:16:49","modified_gmt":"2019-12-12T13:16:49","slug":"pi-liang-chu-li","status":"publish","type":"post","link":"https:\/\/blog.naibabiji.com\/skill\/pi-liang-chu-li.html","title":{"rendered":"WordPress\u6279\u91cf\u5220\u9664\u5206\u7c7b\u6587\u7ae0_\u6e05\u7a7a\u7279\u8272\u56fe\u7247_\u4fee\u6539\u6587\u7ae0\u72b6\u6001"},"content":{"rendered":"<p>\u6709\u65f6\u5019\u7f51\u7ad9\u6539\u7248\u4f1a\u6d89\u53ca\u5230\u5927\u91cf\u6587\u7ae0\u7684\u4fee\u6539\uff0c\u624b\u52a8\u64cd\u4f5c\u592a\u8d39\u65f6\u95f4\uff0c\u6240\u4ee5\u5976\u7238\u5efa\u7ad9\u7b14\u8bb0\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0bWordPress<strong>\u6279\u91cf\u5220\u9664\u5206\u7c7b\u76ee\u5f55\u7684\u6587\u7ae0<\/strong>\u3001<strong>\u6e05\u7a7a\u6587\u7ae0\u7279\u8272\u56fe\u7247\u3001\u66ff\u6362\u5185\u5bb9<\/strong>\u548c<strong>\u4fee\u6539\u6587\u7ae0\u53d1\u5e03\u72b6\u6001<\/strong>\u7684\u65b9\u6cd5\u3002<\/p>\n<p><span style=\"color: #ff0000;\">\u8bf7\u6ce8\u610f\uff0c\u672c\u6587\u7ae0\u5206\u4eab\u7684\u65b9\u6cd5\u5728\u6570\u636e\u5e93\u64cd\u4f5c\u7684\uff0c\u8bf7\u5148\u5907\u4efd\u3002<\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/blog.naibabiji.com\/tutorial\/bt-backup.html\">\u5b9d\u5854\u9762\u677f\u81ea\u52a8\u5907\u4efd\u7f51\u7ad9\u548c\u6570\u636e\u5e93\u5230FTP\u5b58\u50a8\u7a7a\u95f4\u6559\u7a0b<\/a><\/li>\n<li><a href=\"https:\/\/blog.naibabiji.com\/tutorial\/cpanel-backup.html\">SiteGround\u865a\u62df\u4e3b\u673a\u7528cPanel\u624b\u52a8\u5907\u4efd\u7f51\u7ad9\u548c\u6570\u636e\u5e93\u6559\u7a0b<\/a><\/li>\n<li><a href=\"https:\/\/blog.naibabiji.com\/tutorial\/wordpress-bei-fen-cha-jian.html\">\u4f7f\u7528\u63d2\u4ef6\u7ed9WordPress\u7f51\u7ad9\u81ea\u52a8\u5907\u4efd<\/a><\/li>\n<\/ul>\n<h2>\u6279\u91cf\u5220\u9664\u5206\u7c7b\u4e0b\u7684\u6587\u7ae0<\/h2>\n<p>1\u3001\u4f7f\u7528phpmyadmin\u767b\u5f55\u4f60\u7684\u6570\u636e\u5e93\u540e\u53f0\uff0c\u5207\u6362\u5230\u4f60\u7f51\u7ad9\u7684\u6570\u636e\u5e93\u91cc\u9762\u3002<\/p>\n<p>2\u3001\u70b9\u51fbSQL\uff0c\u590d\u5236\u6570\u636e\u5e93\u547d\u4ee4\uff0c\u7136\u540e\u6267\u884c\u3002<\/p>\n<p><a href=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2019\/12\/ScreenShot00351.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3913\" src=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2019\/12\/ScreenShot00351.png\" alt=\"\u6279\u91cf\u5220\u9664\u6570\u636e\u5e93\u6587\u7ae0\" width=\"821\" height=\"488\" \/><\/a><\/p>\n<p>\u6570\u636e\u5e93\u547d\u4ee4\u5982\u4e0b\uff0c\u6700\u540e\u76841792\u4ee3\u8868\u4f60\u8981\u5220\u9664\u7684\u5206\u7c7b\u76ee\u5f55ID\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u9f20\u6807\u79fb\u52a8\u5230\u5206\u7c7b\u76ee\u5f55\u4e0a\u770b\u7f51\u5740\u91cc\u9762\u7684ID\u4fe1\u606f\u5224\u65ad\u662f\u591a\u5c11\u3002<\/p>\n<pre>delete\r\nfrom\r\nwp_posts \r\nusing \r\nwp_posts,\r\nwp_term_relationships,\r\nwp_term_taxonomy \r\nwhere \r\nwp_posts.id=wp_term_relationships.object_id \r\nand \r\nwp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id \r\nand \r\nwp_term_relationships.term_taxonomy_id = 1792<\/pre>\n<p>\u6267\u884c\u5b8c\u6bd5\u540e\u4f1a\u544a\u8bc9\u4f60\u7ed3\u679c\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><a href=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2019\/12\/ScreenShot00352.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3912\" src=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2019\/12\/ScreenShot00352.png\" alt=\"\u6279\u91cf\u5220\u9664\u6570\u636e\u5e93\u6587\u7ae0\" width=\"821\" height=\"303\" \/><\/a><\/p>\n<h2>\u6279\u91cf\u66ff\u6362\u5185\u5bb9\u548c\u7f51\u5740<\/h2>\n<p>\u5982\u679c\u4f60\u7f51\u7ad9\u6362\u4e86\u57df\u540d\u6216\u8005\u540d\u79f0\uff0c\u90a3\u4e48\u4f60\u4e4b\u524d\u6587\u7ae0\u91cc\u9762\u63d2\u5165\u7684\u7f51\u5740\u548c\u540d\u79f0\u90fd\u9700\u8981\u4fee\u6539\u624d\u884c\uff0c\u81ea\u5df1\u624b\u52a8\u53bb\u4fee\u6539\u592a\u9ebb\u70e6\u4e86\uff0c\u76f4\u63a5\u4f7f\u7528\u63d2\u4ef6\u5427\uff0c\u56fe\u5f62\u5316\u754c\u9762\u64cd\u4f5c\uff0c\u975e\u5e38\u7b80\u5355\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/blog.naibabiji.com\/skill\/wordpress-pi-liang-ti-huan-nei-rong.html\">WordPress\u6279\u91cf\u67e5\u627e\u66ff\u6362\u4fee\u6539\u6587\u7ae0\u5185\u5bb9\u7684\u63d2\u4ef6\u548c\u4ee3\u7801<\/a><\/li>\n<\/ul>\n<p>\u5982\u679c\u8981\u4f7f\u7528\u6570\u636e\u5e93\u547d\u4ee4\u66ff\u6362\u7684\u8bdd\u5c31\u662f\u4e0b\u9762\u8fd9\u4e00\u53e5\u3002<\/p>\n<pre>UPDATE wp_posts SET post_content = REPLACE(post_content, '\u539f\u5185\u5bb9' , '\u66ff\u6362\u4e3a\u7684\u5185\u5bb9');<\/pre>\n<h2>\u6279\u91cf\u6e05\u7a7a\u7279\u8272\u56fe\u7247<\/h2>\n<p>\u5982\u679c\u4f60\u6587\u7ae0\u6709\u7684\u8bbe\u7f6e\u4e86\u7279\u8272\u56fe\u7247\uff0c\u6709\u7684\u6ca1\u8bbe\u7f6e\u7279\u8272\u56fe\u7247\uff0c\u7136\u540e\u66f4\u6362\u4e86\u65b0\u4e3b\u9898\uff0c\u5bfc\u81f4\u7279\u8272\u56fe\u7247\u5f88\u4e11\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6279\u91cf\u5220\u9664\u6587\u7ae0\u7279\u8272\u56fe\u7247\u6570\u636e\uff08\u4e0d\u4f1a\u5220\u9664\u7279\u8272\u56fe\u7247\u7684\u6587\u4ef6\uff09<\/p>\n<p><strong>WordPress\u7279\u8272\u56fe\u7247\u76f8\u5173\u6587\u7ae0\uff1a<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/blog.naibabiji.com\/tutorial\/wordpress-random-post-thumbnails.html\">WordPress\u968f\u673a\u663e\u793a\u7279\u8272\u56fe\u7247\u63d2\u4ef6\uff1aRandom Post Thumbnails<\/a><\/li>\n<li><a href=\"https:\/\/blog.naibabiji.com\/skill\/shan-chu-wordpress-suo-lue-tu.html\">4\u79cd\u5220\u9664WordPress\u7f29\u7565\u56fe\u7684\u65b9\u6cd5_\u6279\u91cf\u6e05\u7406\u5783\u573e\u56fe\u7247<\/a><\/li>\n<\/ul>\n<p>\u4e3b\u9898\u51fd\u6570\u6587\u4ef6functions.php\u63d2\u5165\u4e0b\u9762\u4ee3\u7801\uff0c<a href=\"https:\/\/blog.naibabiji.com\/tutorial\/wordpress-code-snippets.html\">\u5b89\u5168\u6dfb\u52a0\u4ee3\u7801\u5230functions.php\u6587\u4ef6\u7684\u65b9\u6cd5\uff1aCode Snippets<\/a><\/p>\n<pre>global $wpdb;\r\n$wpdb-&gt;query( \"\r\nDELETE FROM $wpdb-&gt;postmeta \r\nWHERE meta_key = '_thumbnail_id'\r\n\" );<\/pre>\n<p>\u6dfb\u52a0\u540e\uff0c\u8bbf\u95ee\u7f51\u7ad9\u5c31\u4f1a\u53d1\u73b0\u6587\u7ae0\u7684\u7279\u8272\u56fe\u7247\u5168\u90e8\u6e05\u7a7a\u4e86\u3002<strong>\u7136\u540e\u628a\u4e0a\u9762\u7684\u4ee3\u7801\u5220\u9664<\/strong>\uff0c\u4e0d\u7136\u4f60\u6c38\u8fdc\u6dfb\u52a0\u4e0d\u4e0a\u7279\u8272\u56fe\u7247\u3002<\/p>\n<h2>\u6279\u91cf\u4fee\u6539\u6587\u7ae0\u53d1\u5e03\u72b6\u6001<\/h2>\n<p>WordPress\u6587\u7ae0\u72b6\u6001\u5206\u4e3a\uff1a\u8349\u7a3f&#8217;draft&#8217;\uff0c\u5df2\u53d1\u5e03&#8217;publish&#8217;\uff0c\u5f85\u5ba1\u6838&#8217;pending&#8217;<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u6279\u91cf\u4fee\u6539\u6587\u7ae0\u72b6\u6001\u7684\u53d8\u66f4\u3002<\/p>\n<pre>UPDATE `wp_posts` SET `post_status` ='draft' WHERE (`post_status`='publish');<\/pre>\n<p>\u4e0a\u9762\u7684\u4ee3\u7801\u610f\u601d\u662f\u628awp_posts\u8868\u91cc\u9762\u7684post_status\u503c\u4fee\u6539\u4e3adraft\uff0c\u5c31\u662f\u8349\u7a3f\u72b6\u6001\uff0c\u4fee\u6539\u54ea\u4e9b\u6587\u4ef6\uff0c\u6839\u636e\u540e\u9762post_status\u7684\u503c\u4e3apublish\u6765\u5224\u65ad\uff0c\u53ea\u6709\u662fpublish\uff08\u5df2\u53d1\u5e03\uff09\u7684\u624d\u4fee\u6539\u4e3a\u8349\u7a3f\u3002<\/p>\n<h2>\u6e05\u7a7a\u5a92\u4f53\u5e93\u6570\u636e\u5e93<\/h2>\n<p>\u5982\u679c\u4f60\u9700\u8981\u6e05\u7a7aWordPress\u5a92\u4f53\u5e93\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u5728\u6570\u636e\u5e93\u4e2d\u6267\u884c\u4e0b\u9762\u8fd9\u4e9b\u547d\u4ee4\u3002<\/p>\n<pre>DELETE from wp_posts where post_type = 'attachment'<\/pre>\n<p>\u4e0a\u9762\u7684\u547d\u4ee4\u53ef\u4ee5\u5220\u9664\u6240\u6709\u5a92\u4f53\u5e93\u4fe1\u606f\u3002\u5982\u679c\u4f60\u60f3\u67e5\u8be2\u5a92\u4f53\u5e93\u4fe1\u606f\u7684\u8bdd\uff0c\u5c31\u662f\u4e0b\u9762\u8fd9\u4e2a\u547d\u4ee4\u3002<\/p>\n<pre>Select * from wp_posts where post_type = 'attachment';<\/pre>\n<p>\u6e05\u7a7a\u5a92\u4f53\u6570\u636e\u5e93\u540e\uff0c\u600e\u4e48\u5220\u9664\u5a92\u4f53\u6587\u4ef6\u548c\u6587\u7ae0\u4e4b\u95f4\u7684\u8054\u7cfb\u5462\uff1f\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u3002<\/p>\n<pre>DELETE FROM `wp_postmeta` WHERE meta_key IN ('_wp_attached_file', '_wp_attachment_backup_sizes', '_wp_attachment_metadata', '_thumbnail_id')<\/pre>\n<p>\u5982\u679c\u53ea\u662f\u67e5\u8be2\u5a92\u4f53\u5e93\u548c\u6587\u7ae0\u7684\u5173\u8054\uff0c\u90a3\u4e48\u5c31\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u3002<\/p>\n<pre> SELECT * FROM  `wp_postmeta` WHERE meta_key IN ('_wp_attached_file', '_wp_attachment_backup_sizes',  '_wp_attachment_metadata',  '_thumbnail_id')<\/pre>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u7684<a href=\"https:\/\/blog.naibabiji.com\/skill\/pi-liang-chu-li.html\">WordPress\u6279\u91cf\u5220\u9664\u5206\u7c7b\u6587\u7ae0_\u6e05\u7a7a\u7279\u8272\u56fe\u7247_\u4fee\u6539\u6587\u7ae0\u72b6\u6001\u7684\u65b9\u6cd5<\/a>\uff0c\u5982\u679c\u4f60\u8fd8\u6709\u5176\u4ed6\u6279\u91cf\u5904\u7406\u7684\u65b9\u6cd5\uff0c\u6b22\u8fce\u4e00\u8d77\u4ea4\u6d41\u3002<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;3910&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;5&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;1.8&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;\u7ed9\u672c\u6587\u6253\u5206 post&quot;,&quot;legend&quot;:&quot;1.8\\\/5 - (5 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;WordPress\u6279\u91cf\u5220\u9664\u5206\u7c7b\u6587\u7ae0_\u6e05\u7a7a\u7279\u8272\u56fe\u7247_\u4fee\u6539\u6587\u7ae0\u72b6\u6001&quot;,&quot;width&quot;:&quot;48.4&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 48.4px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            1.8\/5 - (5 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\u7f51\u7ad9\u6539\u7248\u4f1a\u6d89\u53ca\u5230\u5927\u91cf\u6587\u7ae0\u7684\u4fee\u6539\uff0c\u624b\u52a8\u64cd\u4f5c\u592a\u8d39\u65f6\u95f4\uff0c\u6240\u4ee5\u5976\u7238\u5efa\u7ad9\u7b14\u8bb0\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0bWordPress\u6279\u91cf\u5220 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3914,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"WordPress\u6279\u91cf\u5220\u9664\u5206\u7c7b\u6587\u7ae0_\u6e05\u7a7a\u7279\u8272\u56fe\u7247_\u4fee\u6539\u6587\u7ae0\u72b6\u6001 - \u5976\u7238\u5efa\u7ad9\u7b14\u8bb0","description":"\u6709\u65f6\u5019\u7f51\u7ad9\u6539\u7248\u4f1a\u6d89\u53ca\u5230\u5927\u91cf\u6587\u7ae0\u7684\u4fee\u6539\uff0c\u624b\u52a8\u64cd\u4f5c\u592a\u8d39\u65f6\u95f4\uff0c\u6240\u4ee5\u5976\u7238\u5efa\u7ad9\u7b14\u8bb0\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0bWordPress \u6279\u91cf\u5220\u9664\u5206\u7c7b\u76ee\u5f55\u7684\u6587\u7ae0 \u3001 \u6e05\u7a7a\u6587\u7ae0\u7279\u8272\u56fe\u7247\u3001\u66ff\u6362\u5185\u5bb9 \u548c \u4fee\u6539\u6587\u7ae0\u53d1\u5e03\u72b6\u6001 \u7684\u65b9\u6cd5\u3002 \u8bf7\u6ce8\u610f\uff0c\u672c\u6587\u7ae0\u5206\u4eab\u7684\u65b9\u6cd5\u5728\u6570\u636e\u5e93\u64cd\u4f5c\u7684\uff0c\u8bf7\u5148\u5907\u4efd\u3002 \u5b9d\u5854\u9762\u677f\u81ea\u52a8\u5907\u4efd\u7f51\u7ad9\u548c\u6570\u636e\u5e93\u5230FTP\u5b58\u50a8\u7a7a\u95f4\u6559\u7a0b SiteGround\u865a\u62df"},"footnotes":""},"categories":[142],"tags":[],"class_list":["post-3910","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/3910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/comments?post=3910"}],"version-history":[{"count":0,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/3910\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media\/3914"}],"wp:attachment":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media?parent=3910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/categories?post=3910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/tags?post=3910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}