WordPress Delete Unused Entries wp_usermeta Table

Hi, WordPress have wp_users table to have main information but to save all other information related to users save to wp_usermeta, Sometime wp_usermeta have lots of entries/data which are not related to anyone and because of this size of table continuously increases, So better is to delete unused entries from wp_usermeta table to decrease load on database table.

If you want to delete all unused orphan entries of users, then you first thing is you must have access to phpmyadmin and have some experience to work with it, If you are new to phpmyadmin then my suggestion to you to stop go ahead, because if you don’t have experience then you might screw up your website.

So now, after open phpmyadmin first take backup of your database in case if something goes wrong, So we can restore backup to site. Now first select your database and then click on SQL tab and simply paste below query in box which opened and click on Go/Run.

 DELETE FROM wp_usermeta WHERE user_id NOT IN (SELECT ID FROM wp_users) 

Once you run this above query it will delete all orphan unused entries from wp_usermeta database table.

I hope this info helps you. If you have any question then you can ask me in comment. Please take backup before running query on database table, We will not responsible for any loss in your data/database.