Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I created a checkbox option for the user_meta (user profile). They are checkboxes assigning users to categories.

The problem is that I need to do a mass update for all of my users 1500+ and going through them individually would take too long.

I need to choose the intended categories for each user. There are 180 categories.

This is a screen shot of the section of the user profile that I want to update:

enter image description here

I need a way of doing this. Im open to using a custom script (preferably not a plugin), csv import, or any other options.

The purpose of the category selections is so that I can save their descriptions in a meta field that will then be searchable with a custom query. This won't work if the users dont have a category(ies) selected. It's a pain now because there is a large amount that I need to do at once, but ideally the categories will be selected as new users are created.

Anyone with a way of achieving this please help. Please let me know if there is any additional info needed.

Thanks a lot

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

update_user_meta() is what should assist you in doing this. Feed what get_users() returns and update the meta data for each and every one of them with the required values.

Assuming that you are going to store a serialized array, your custom query will have to unserialize each result in order to perform a search. I may not know the full extent of your intentions, but I hope this helps.

share|improve this answer
    
Thank you Soulseekah. Yes, I think you advice will help me. I found this question/answer (wordpress.stackexchange.com/questions/13353/…) that relates to what you mentioned. I basically need to update array selections for each user. Thanks for your feedback! –  user1893 Oct 21 '11 at 15:16
    
Glad to have been of some guidance. –  soulseekah Oct 22 '11 at 5:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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