wordpress清理自动保存和多余的内容-通用所有版本

之后所通用所有版本,其实很简单,建立二个定时任务,自动清理即可,用什么方法,取决于你,在这里,我使用用MYSQL本身事件功能
下面功能是,每天清理一次

1、清理自动保存的内存,运行如下SQL文件

CREATE DEFINER=`root`@`%` EVENT `清理自动保存内容` ON SCHEDULE EVERY 1 DAY STARTS '2013-07-12 13:25:53' ON COMPLETION NOT PRESERVE ENABLE DO DELETE FROM yy_posts WHERE post_status = 'auto-draft'

2、清理产生的多版本内容

CREATE DEFINER=`root`@`%` EVENT `自动清理多版本` ON SCHEDULE EVERY 1 DAY STARTS '2013-07-12 13:25:53' ON COMPLETION NOT PRESERVE ENABLE DO DELETE FROM yy_posts WHERE post_status = 'inherit'

Comments are closed