This question already has an answer here:

We have about 12000 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?

I try this code :-

INSERT IGNORE INTO an_usermeta (user_id, meta_key, meta_value)
u.ID, 'wp_capabilities', 'a:1:{s:11:"contributor";b:1;}'
FROM an_users u

But when go to wp-admin i don't see any user for contributor role Thanks,

marked as duplicate by gmazzap, Pieter Goosen, fuxia Oct 26 '14 at 15:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Manually change 1 user to a contributor then view their wp_capabilities entry in wp_usermeta table.

Update the rest of the table to set wp_capabilities to this value for the 12,000 users.

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