Home › Forums › General Issues › Hidden Some Setting on Post or Page › Reply To: Hidden Some Setting on Post or Page
Add this to your functions.php:
add_action('admin_head', 'remove_metaboxes_for_non_admin');
function remove_metaboxes_for_non_admin(){
if (!is_admin()){ // only remove for non admins
remove_meta_box('wpseo_meta', 'post', 'normal'); // removes the wordpress seo by yoast metabox from posts
remove_meta_box('wpseo_meta', 'page', 'normal'); // removes the wordpress seo by yoast metabox from pages
// continue adding as necessary
}
}
See here for remove_meta_box reference.
You can find the “ids” of the metaboxes by inspecting the code to see what the id is for the div wrapping the box.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Our guide looks into WordPress custom fields and how they stack up against the possibilities of ACF.
— Advanced Custom Fields (@wp_acf) July 18, 2022
https://t.co/hk3yibkHyk
© 2022 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.