清除wordpress无用的sql信息
星期日, 2014-01-12 | Author: Lee | wordpress | 5,383 views
直接上sql代码了
DELETE FROM wp_posts WHERE post_type = 'revision'; DELETE FROM wp_posts WHERE post_status = 'draft'; DELETE FROM wp_posts WHERE post_status = 'auto-draft'; DELETE FROM wp_comments WHERE comment_approved = '0'; DELETE FROM wp_comments WHERE comment_approved = 'spam'; DELETE FROM wp_comments WHERE comment_approved = 'trash'; DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments); DELETE FROM wp_term_relationships WHERE term_taxonomy_id=1 AND object_id NOT IN (SELECT id FROM wp_posts); DELETE FROM wp_options WHERE option_name LIKE '_site_transient_browser_%' OR option_name LIKE '_site_transient_timeout_browser_%' OR option_name LIKE '_transient_feed_%' OR option_name LIKE '_transient_timeout_feed_%'; 优化数据表,可以用以下的语句: OPTIMIZE TABLE wp_commentmeta; OPTIMIZE TABLE wp_comments; OPTIMIZE TABLE wp_links; OPTIMIZE TABLE wp_options; OPTIMIZE TABLE wp_postmeta; OPTIMIZE TABLE wp_posts; OPTIMIZE TABLE wp_terms; OPTIMIZE TABLE wp_term_relationships; OPTIMIZE TABLE wp_term_taxonomy; OPTIMIZE TABLE wp_usermeta; OPTIMIZE TABLE wp_users; |
文章作者: Lee
本文地址: https://www.pomelolee.com/1272.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)