• I have over 2000 members in my wp database but not all are subscribers. Most don’t have anything. My question is can I run a mysql query that will change all the members to subscribers? I would like to do it in one full sweep via the query.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The danger there is that you may make yourself a subscriber too!

    In the wp_usermeta table, you want to find their wp_capabilities and make it a:1:{s:10:"subscriber";s:1:"1";}

    Thread Starter dandelionnights

    (@dandelionnights)

    Yes but I can change the admin account back to

    a:1:{s:13:”administrator”;s:1:”1″;}

    I just need to change all the users to subscribers. I’m looking for a complete query for mysql that I can run because i have 2000 members and that’s a lot to change manually.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Right, it’s a search wp_usermeta for the meta_key of wp_capabilites and replace the value. ??

    Also known as ‘I don’t know the query off the top of my head, but since you seem copacetic with SQL, you probably know how it works in general, so you can figure it out from here.’

    Thread Starter dandelionnights

    (@dandelionnights)

    Well, I don’t see a replace function in phpmyadmin so here I am looking for the query. I have noticed that the roles that say “None” in the admin area have NO entry for wp_capabilities so I assume that I need to insert the a:1:{s:10:”subscriber”;s:1:”1″;} into it but damn if I know how to do it in one full sweep.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Untested…

    UPDATE wp_usermeta SET meta_value = '{s:10:"subscriber";s:1:"1";}' WHERE meta_key = 'wp_capabilities';

    So what we’re saying here is ‘Set the Meta VALUE to Subscriber where the KEY is ‘capabilities’. ??

    Thread Starter dandelionnights

    (@dandelionnights)

    I will surely test this now and let you know… Thank you for that. More to come.

    Thread Starter dandelionnights

    (@dandelionnights)

    Well, the command ran and set all the wp_capabilities to the subscribers but when I view the Role in the WP Admin Users area it says “None”. Any suggestions?

    thatwastaxing

    (@thatwastaxing)

    Try using ‘a:1:{s:10:”subscriber”;s:1:”1″;}’ instead in Ipstenu’s code

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Make all members "Subscribers"’ is closed to new replies.