Updating user meta
-
Hi,
I’m looking for support with updating all users’ meta with a script once manually. Thanks very much in advance.
There is user meta: “restrict level”. I want to update all users so that their restrict level is the same as their user group value. They may change later but this would be a great starting point for the new update.
I think I need to do something like:
for USER_ID in $(wp user list --role=subscriber --field=ID); do wp user update $USER_ID --restrict level=*; done
where * means “same as the user group value” for given user:
eg: group A, group B, group C…Can anyone advise me what this line of code should be?
Bw,
Ben
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Updating user meta’ is closed to new replies.