Home › Forums › Support › hide "Disable Elements" and "Sidebars" by user role with a hook This topic has 6 replies, 2 voices, and was last updated 3 years, 8 months ago by David. Viewing 7 posts - 1 through 7 (of 7 total) Author Posts May 7, 2020 at 10:35 pm #1274777 Oriol hi, I would like to hide to editors the ability to change page structure (use sections, sidebars and layout), in the settings of page/post editor. how can i do that with a hook? thanks May 8, 2020 at 8:58 am #1275567 LeoStaff Customer Support Hi there, This should help: https://docs.generatepress.com/article/generate_metabox_capability/ Examples: https://generatepress.com/forums/search/generate_metabox_capability/ May 10, 2020 at 7:01 am #1277729 Oriol Hi Leo, thanks, I try it May 10, 2020 at 9:25 am #1278047 LeoStaff Customer Support Let me know 🙂 August 11, 2020 at 2:33 am #1396739 Nic have a question with this. while this code works to prevent the editor user role from using page edit gp meta boxes: function limit_gp_metaboxes($cap){ if(current_user_can('editor')) return false; return $cap; } add_filter("generate_metabox_capability","limit_gp_metaboxes"); the same user is still able to modify gp meta boxes in elements blocks. is there another hook? August 11, 2020 at 2:41 am #1396742 Nic found out this will do the trick: function remove_elements_metabox() { if(current_user_can('editor')) { remove_meta_box('generate_premium_elements', 'gp_elements', 'normal'); } } add_action( 'add_meta_boxes', 'remove_elements_metabox', 999 ); August 11, 2020 at 5:56 am #1396972 DavidStaff Customer Support Glad to hear you found the solution Author Posts Viewing 7 posts - 1 through 7 (of 7 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In