按修订数选择Wordpress文章
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按修订数选择Wordpress文章相关的知识,希望对你有一定的参考价值。
Too many revisions taking up space in your database? Use this script to find which posts have more than 10 - and then you can figure out what to do with them.
$query = "SELECT COUNT(*), `ID`, `post_title`, `post_content`, `post_parent`, `post_modified`, `post_name` FROM $wpdb->posts WHERE `post_type` = 'revision' AND DATE(`post_modified`) < DATE_SUB(CURDATE(), INTERVAL 30 DAY) GROUP BY `post_parent` HAVING COUNT(*) > 10 ORDER BY COUNT(*) DESC LIMIT 10";
以上是关于按修订数选择Wordpress文章的主要内容,如果未能解决你的问题,请参考以下文章