JPashs
JPashs

Reputation: 13886

Sql query to bulk change roles in Wordpress in the database?

Wordpress: I need to bulk change user roles in the database using the "user id". Something like:

"Find users with id: 2827, 772, 234, 983, 14999 and set their rol to "custumer"

I know that the roles are saved in the table "wp_usermeta" in the fields "meta_key=wp_capabilities" and "meta_value=a:1:{s:6:"editor";b:1;}".

But I don't know how to create the slq query to search and replace them to change their values.See capture attached.

enter image description here

Upvotes: 0

Views: 1199

Answers (1)

user8574938
user8574938

Reputation:

Easiest for me is to use phpmyadmin and edit one record. The response will give you the proper sql statement. Then run that for the other ids

Upvotes: 0

Related Questions