0

We have about 8000 users who doesn't have any roles. we need to change them to "contributor". How can I change them to "contributor"? Should I do on database? if so, which fields I need to update?

Thanks,

1
  • Have you don't set any role for them? Please show us the entry from a user without any role and his usermeta value for wp_capabilities.
    – kaiser
    Commented Aug 26, 2013 at 13:42

1 Answer 1

2

You can do it by executing simple SQL query:

UPDATE wp_usermeta
   SET meta_value = 'a:1:{s:11:"contributor";b:1;}' 
 WHERE meta_key = 'wp_capabilities' 
   AND meta_value = 'a:1:{s:10:"subscriber";b:1;}'

This query will updated all subscribers to be contributors.

3
  • thanks for your answer. but some users don't have any roles. their's roles are "None". then how I need to update?
    – pulla
    Commented Aug 26, 2013 at 15:12
  • Find out what wp_capabilities meta contains for these users. Commented Aug 26, 2013 at 15:24
  • there is no wp_capbilities for some users. i can't find them on user-meta
    – pulla
    Commented Aug 26, 2013 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.