Removed “post revision” of WordPress
có nghĩa là tôi đã viết tới … 10.000 bài viết (Thực tế,”>There are times my horror when accessing the database, look at the table wp_posts (store full article on WordPress blog) and saw nearly 10,000 samples -> means that I write to … 10,000 posts (Actually, Current posts on the blog is only about 1166 items)!? “Mom, write to die or that you write much more than one year?”. Was considered test I see a lot of records with duplicate content! Why?
Learn, know that is features “post revision” of WordPress. Each time you open the article, edit and save (or WP automatically saved), it will be saved as a new line in the database. The purpose of this job is to help you return to the previous version if unfortunately you delete all the content and click the Save button. nội dung hiện tại sẽ bị thay thế bởi nội dung được lưu vào thời điểm revision”>Open an article, you will find below the editor there is a section called “Revisions”, click on the revision you want to restore the -> current content will be replaced by the content stored at the time of revision it is created.
There are too many unnecessary items will make accessing the database becomes slow and blog load time is longer, it is important for data backup when you have too much redundant data! You can use the dedicated plugin to delete the revision or self-made by hand in the following way and can disable this feature of WP …
Cleaning up the articles in the database:
bấm vào thẻ SQL và gõ vào dòng lệnh sau :”>Access to the database administrator> click on the SQL tab and type in the following command line:
DELETE FROM ten_bang_posts WHERE post_type = ‘revision’
In which “ten_bang_posts” is the full name of the table “posts” in your database. My example is “anhhangxomonlie_posts”. Finished press the “Go” button, the warning dialog box that appears, click OK.
If successful you will see it how many records have been deleted as follows:
As in the picture, it helped me remove 4881 lines of redundant data in the database.
Disable features “post revision” of the WP:
You open the file “wp-config.php” and add the following line
define (‘WP_POST_REVISIONS’, false);