Support

Account

Home Forums General Issues Hidden Some Setting on Post or Page

Solved

Hidden Some Setting on Post or Page

  • I want to remove it (the red mark) of a non-admin, how to disable this? I use Blaszok theme from Themeforest, and ACF is required plugins for the theme. If I not activate the ACF, the settings on a post or page is not displayed, but if activated ACF, setting shows …. If I do not turn on the ACF, the theme does not work.. Please help me, i want remove it from non-admin…

    Thanks.

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

  • But wait, how to remove from add product page (WooCommerce)?

    Thanks…

  • Om osmond stress ya?? hahahaaa…..

  • The second parameter of the remove_meta_box method takes the post_type. So if your custom post type is “products”, just do remove_meta_box("wpseo_meta", "products", "normal");

    Also, keep in mind that the third parameter is one of “normal”, “advanced”, or “side” and is dependent on where that meta box is situated. Basically, if normal doesn’t work, try advanced. 🙂

  • Great, thanks for reply… 😀

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.