Support » Plugin: Members - Membership & User Role Editor Plugin » Assign Roles in Bulk to Pages

  • Using the Members plugin I can create a custom role and then assign that role to Posts and Pages manually one at a time. Is there any way to assign roles to Posts and/or Pages in bulk (like uploading a CVS, etc.)?

Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @jryutzy

    We don’t have any Import tool but roles for posts and pages are stored in the wp_postmeta table and meta key is called _members_access_role. If you want to add Editor role to some post or pages, you can just use update_post_meta function like this:

    
    $posts = array(10,23,35); // Posts IDs
    foreach($posts as $post) {
      update_post_meta($post->ID, '_members_access_role', 'editor');
    }

    Hopefully, that helps.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.