• Hi Everyone,
    I need some help with wordpress users meta data.

    I was recently hit by a Spam bot attack and had about 300 users registered on my site + 50,000 posts created because I had changed the defaults unkowingly.

    Since then I have cleaned up the posts from the SQL database and for users since I could not figure out the proper way to do it, I deleted them one by one from the sql table interface through the Cpanel php admin.

    As a result now I am down to 91 real users on my site but on the front end it still shows 300 odd users. Is there anyway to clean up the metadata so the totals in the front end interface are right.

    Thanks in advance for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The user count is generated from user meta, so you’ll need to clean that up:

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

    (Change your table names accordingly if you’re using a prefix other than wp_)

    As always, back up your usermeta table before running this – just in case.

    Thread Starter flowerheart

    (@flowerheart)

    My friend, THanks , Merci, Dhanywaad , Shukriya

    Thanks for showing the way it worked beautifully,

    First tried it with SELECT and then repeated with DELETE.

    Excellent stuff.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress users count and meta data problems’ is closed to new replies.