What are WordPress orphaned term meta and how to clean them?

The term metadata is the information that is provided for each taxonomy term. This information usually includes additional data that is not stored in the terms table of WordPress. In some cases, some term metadata information becomes orphaned and does not belong to any taxonomy term. They are then called “orphaned term meta” and should be cleaned since they are not useful.

To clean this orphaned term meta, you can either use our plugin Advanced Database Cleaner, or execute the following SQL code (which is used by the plugin) directly via your phpMyAdmin:

DELETE FROM termmeta WHERE term_id NOT IN (SELECT term_id FROM terms)