Home > Wordpress > 禁用wordpress Post Revisions

禁用wordpress Post Revisions

December 20th, 2008 humker Leave a comment Go to comments

wordpress有个很讨厌的功能,叫Post Revisions,保存博文日志的不同版本,同样的内容多次占用数据库,多人用户维护一个blog用这个有用处,单一维护的blog基本是数据库浪费空间。
禁用Post Revisions的方法是,在wp-config.php文件中增加一行

define(’WP_POST_REVISIONS’, false);

那么如何讨回原来被Post Revisions占用的数据库空间呢?很简单,先登录phpmyadmin,在执行sql语句处,贴上下面的语句。执行此语句前请备份数据库

DELETE FROM wp_posts WHERE post_type = “revision”;

autosave功能还是保留吧,以免出来问题就浪费自己打字的时间。

Categories: Wordpress Tags:
  1. No comments yet.
  1. No trackbacks yet.
Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).