WordPress.org

Ready to get started?Download WordPress

Forums

Change roles of 500+ users (2 posts)

  1. henkmsncam
    Member
    Posted 7 years ago #

    Hi,

    In the beginning I made all my registering visitors/users contributor. After a while I thought that subscriber was smarter so I set that as a standard. Now I have 1000+ registered users and would like to change all contributors to subscribers. Clicking 500 times is probably not the smartest way to do this. Any ideas?

    Thx!

  2. MichaelH
    Member
    Posted 7 years ago #

    First backup your database, in particular your wp_usermeta table.

    Assuming your $table_prefix in wp-config.php is wp_

    Try this:

    UPDATE wp_usermeta SET meta_value = replace(meta_value,'a:1:{s:11:"contributor";b:1;}','a:1:{s:10:"subscriber";b:1;}');
    UPDATE wp_usermeta SET meta_value = 0 WHERE meta_key='wp_user_level' and meta_value=1;

    Got this idea from
    http://wordpress.org/support/topic/99351?replies=3

Topic Closed

This topic has been closed to new replies.

About this Topic