Hi @emilyb6116
We don’t have bulk content permission feature, so the best way to protect multiple pages at once would be to run the code snippet below and replace page IDs:
$pages = array(1297, 14);
foreach($pages as $page) {
update_post_meta($page, '_members_access_role', 'administrator');
}
I protected two pages in this code but you can add more pages or use more advanced code to pull specific pages from the database.
I hope that helps.
Great, thank you!
Will this add the specified role to whatever is there, or replace the role all together if there is one already in place?
This will update role for pages from the array if they exist, and add new one if it does not exist.
Best
That worked. Thank you! I had to end up changing update_post_meta to add_post_meta to get it to keep the existing permissions and add the additional one.