Delete Orphaned Post Meta from WP

If you find this free website useful – why don’t you support this with a donation? It is easy…. read more ….

Sometimes you will want to tidy the database, maybe from a development issue.

Removing orphaned post meta is simple in SQL

There are several posts about deleting Orphaned Post Meta Data in WordPress, some are dangerous, some are wrong, some have syntax errors.

This works

delete from wp_postmeta  where post_id not in (select ID from wp_posts)






Leave a Reply

Your email address will not be published. Required fields are marked *