Removing YOAST metabox for authors (5 posts)

  1. karlalopez
    Posted 4 years ago #

    I'm trying to remove YOAST metabox in my Add New Post page only for non-admins.

    I came across this instruction but I'm not really sure how it works.

    I have 2 questions:

    1. (A really dumb one, sorry!) Is this code supposed to go on pont-new.php file? There's no reference about where I should place it in the Codex link and I have less than basic knowledge on this.

    2. How do I find out if the $context is Normal or Advanced?

    Thank you!

  2. Should be able to do this in teh default settings:


    Go to Hide WordPress SEO box on edit pages for the following post types: and pick 'posts' - That does hide it for everyone, HOWEVER. You can still activate it if you want.

  3. karlalopez
    Posted 4 years ago #

    It's a custom post type, so wpseo dashboard does not help me :(

    The example here

    if (is_admin()) :
    function my_remove_meta_boxes() {
     if(!current_user_can('administrator')) {
      remove_meta_box('sqpt-meta-tags', 'post', 'normal');
    add_action( 'admin_menu', 'my_remove_meta_boxes' );

    would actually be perfect. Too bad I cant make it work.

  4. CPTs show up on that page for the option as well.

    That code isn't working because it's a CPT though :)

    remove_meta_box('sqpt-meta-tags', 'post', 'normal');

    Change POST to whatever your CPT slug is.

  5. joant6
    Posted 4 years ago #

    Hi, do you know if Hide WordPress SEO box on edit pages for the following post types option disappeared in last version 1.2.2. Can't find it!

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic