WordPress修改
停用文章版本(Post Revision)
文章版本為Wordpress 2.6的新功能,每一次修改儲存文章的記錄都會保存下來,但它的做法我不是很喜歡,會造成文章不斷增加,因此想把它停用。
1. 在wp-config.php任意一行加上
define('WP_POST_REVISIONS', false);
2. 在mysql操作介面(如phpmyadmin)執行下列SQL敘述刪除已儲存的文章版本
DELETE FROM wp_postmeta WHERE post_id IN (SELECT id FROM wp_posts WHERE post_type ='revision');
DELETE FROM wp_term_relationships WHERE object_id IN (SELECT id FROM wp_posts WHERE post_type='revision');
DELETE FROM wp_posts WHERE post_type='revision';
一篇文章可能會在wp_postmeta,wp_term_relationships,wp_posts三個table產生關聯,所以才有三個delete敘述
重要資源:
WordPress Codex Developer Documentation
WordPress Source
WordPress Themes Free
WordPress Theme Viewer