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!
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.