Forums

bulk user level update : contributor to subscriber (6 posts)

  1. qt11
    Member
    Posted 2 years ago #

    Dear All

    I have a site with over 13,000 members all are set to be contributors so they could create content....

    I've just installed tdo forms, so I don't need this any more....

    I'd like to do a mass update of all contributors to subscribers, is there a sql script that i could run that would do this.... ?

    doing it in the web frontend is taking way too long !!

    Cheers
    A

  2. vtxyzzy
    Member
    Posted 2 years ago #

    BACK UP YOUR DATABASE FIRST!!

    You will need to change 'wp_' to your database prefix if it is different.

    UPDATE wp_usermeta
    SET meta_value = 'a:1:{s:10:"subscriber";b:1;}'
    WHERE meta_key = 'wp_capabilities'
    AND meta_value = 'a:1:{s:11:"contributor";b:1;}'
  3. Mark / t31os
    Moderator
    Posted 2 years ago #

    You will need to change 'wp_' to your database prefix if it is different.

    NOTE: Not on this line though. WHERE meta_key = 'wp_capabilities' , as this refers to an option name, and not a db table.

    Just incase that wasn't clear to the poster .. ;)

  4. vtxyzzy
    Member
    Posted 2 years ago #

    @t31os_, in my site where I use a different prefix, the option name is also prefixed with the database prefix. Don't know if that is true in all versions of WP, or just in 2.8.6. Suspect it is true everywhere.

  5. MichaelH
    Volunteer
    Posted 2 years ago #

    vtxyzzy - I believe you are correct with that. The user_level setting in that table is the same thing - $table_prefix is prefaced to that key.

  6. Mark / t31os
    Moderator
    Posted 2 years ago #

    lol, silly me, didn't even realise, usually stick with the default myself, i just assumed... whoops.. ;)

    Kindly disregard my last post. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags