Clean Up Redundant Data in WordPress Database

SQL queries and tips to remove revisions, transients, and orphaned data from WordPress.

Sat May 13 2023
— words · — minutes

Overview

SQL queries and tips to remove revisions, transients, and orphaned data from WordPress.

Originally published on Jang Keyte's Blog.

This article covers Clean Up Redundant Data in WordPress Database — practical notes from real-world web development experience.

Code Examples

DELETE FROM eot3utvmj_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM eot3utvmj_comments);

DELETE FROM eot3utvmj_commentmeta WHERE meta_key LIKE '%akismet%';
DELETE FROM eot3utvmj_postmeta WHERE meta_key = "_edit_lock";

DELETE FROM eot3utvmj_postmeta WHERE meta_key = "_edit_last";

DELETE FROM eot3utvmj_options WHERE option_name LIKE ('%\_transient\_%');

Read More

For the full Vietnamese version, switch language using the VI | EN toggle above, or visit the original post.


Thanks for reading!

Clean Up Redundant Data in WordPress Database

Sat May 13 2023
— words · — minutes