I’m adding some occasional housekeeping to sites, and looking for facts and opinions.
Post Metadata should be associated with posts – but quite often it gets unlinked – orphaned. WordPress notoriously accumulates these, and after years of working with WP, I only found out about this recently.
It looks like some orphaned post meta records in my sites are related to Smush.
To see it, load the WP-Sweep plugin, then from Tools>Sweep look at the count of Orphaned Post Meta. Click “Details” to see the list.
To DEV :
1) Please advise (blog?) on whether doing a mass delete of orphaned post meta is something that we can do without concern, maybe after hours, or if you believe this should be approached more carefully. The WP-Sweep plugin doesn’t offer selection by date. I’m wondering if we can/should remove records with a modification date older than x days?
2) Please check your code to eliminate accumulation of orphaned post meta.
3) Please consider a Branda Option to do housekeeping to remove these appropriately.
Revisions
Similarly WP can accumulate post revisions. Check WP-Sweep to see yours. Standard handling of revisions is to limit it to some count per-post or to disable it entirely.
I would prefer to delete revisions that have a modification date older than x days. This can easily be done with SQL and scheduled with cron, but …
To DEV :
4) What do you think of adding this kind of housekeeping to Branda?
5) Simply deleting post-type ‘revision’ is a commonly published remedy but I’m concerned about creating post-meta orphans and leaving other relational anomalies. Can someone there comment on whether this is actually the right way to clear revisions? (While I spend time in core code, I haven’t looked at the code that does this yet.)
Bottom line : Let’s try to end this thread with a definitive statement on exactly how to cleanly purge old revisions and orphaned post_meta.
Thanks! ( OK OK – so this is really the bottom line :grin: )