Orphan postmeta records left over
-
Hi,
I have a site with only a handful posts, but a DB size of > 100 MB. So I checked the tables manually and found many revisions plus thousands of postmeta rows, the postmeta table being 110 MB in size due to elementor content being saved there.
After deleting the revisions with this plugin according to the logs 2500 revisions were deleted. However the postmeta table was still > 100 MB , and now it has thousands of orphan entries (which I had to find out with custom sql).
So – it may be a misconception of what this plugin is supposed to do … given the name “Optimize Database after Deleting Revisions” and the good reputation I was expecting that it does the heavy lifting to avoid manual SQL fiddling when removing Revisions. To the contrary, it only deleted revisions from wp_posts and did not remove those entries correctly. Is this a bug , or by design? If so, it is questionable design. When deleting a post using WordPress core functions (like
wp_delete_post()), WordPress automatically deletes all associatedpostmetarows. Leaving orphan postmeta behind may be caused by hard sql delete operations in the posts table, which is not recommended.Bottom line – either treat this as a bug report, or a feature suggestion – depending on what the plugin is designed to do with revisions. At least users should be notified that additional cleanup may be necessary.
Regards
Ulrich
You must be logged in to reply to this topic.