Clean Up WordPress User Meta Data Table


During a maintenance of a blog, I needed to clean up the user metadata table since many users was deleted from the main user table (wp_users) with a direct query.

The quick and dirty solution is to run a “left join delete”. Here the SQL statement:

Easy and really quick (please avoid to clean up with a delete plus a sub-query which is the slowest method in the world – other than do it by hand row by row).

My excuses for my bad english but it's the only way I have to communicate with you. Would you suggest a correction? Leave a comment, thank you!

Leave a Reply