Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Change where Yoast Meta box is positioned on all pages/posttypes

  • Hi.

    I would really like the Yoast SEO meta box to be the last thing that appears when editing a Page or Post. I use a allot of custom fields and would like to force the Yoast to be the last box that appears. Does anyone know what I can add to my functions.php to achieve this. It’s just a little intrusive. I know you can order them manually, but this is no good when a new user is added.

    http://wordpress.org/extend/plugins/wordpress-seo/

Viewing 8 replies - 1 through 8 (of 8 total)
  • I found this but it doesn’t seem to work 1.2.7:

    add_action( ‘add_meta_boxes’, ‘change_prio’ );

    function change_prio()
    {
    apply_filters( ‘wpseo_metabox_prio’, ‘low’ );
    }

    I have found a solution but it involves changing the plugin core code.

    If anyone has a better solution I would be keen to hear.

    To get it working I changed (class-metabox.php):

    add_meta_box( ‘wpseo_meta’, __( ‘WordPress SEO by Yoast’, ‘wordpress-seo’ ), array( $this, ‘meta_box’ ), $posttype, ‘normal’, apply_filters( ‘wpseo_metabox_prio’, ‘low‘ ) );

    Can I please further my support for the metabox priority to be changeable – or not set to HIGH

    thanks

    + 1

    How exactly do you use it? I’ve tried:

    apply_filters( 'wpseo_metabox_prio', 'low' );

    in my functions.php but doesn’t work. I think its because the plugins get loaded before the theme does and its too late to use it in the functions.php file. Is there an elegant way without changing the plugin code?

    Try adding this to your functions.php:

    // Filter Yoast Meta Priority
    add_filter( ‘wpseo_metabox_prio’, function() { return ‘low’;});

    Omg, this works! Thanks, man!

    Should just note that I had to add it to my functions.php like so:

    // Move Yoast to bottom
    function yoasttobottom() {
    	return 'low';
    }
    
    add_filter( 'wpseo_metabox_prio', 'yoasttobottom');

    Works perfectly though.

    Just a note in case someone can’t get this to work (like me at first):

    If you have changed the order of the meta boxes manually, it will overwrite any filters added above (or at least it did for me).

    To reset your meta-box order, i searched the database with the following query (phpMyAdmin or any other tool you use)

    SELECT *
    FROM  wp_usermeta
    WHERE  user_id=1
    AND  meta_key LIKE  'meta-box%'

    Each row returned will be a different post type, so just delete the row associated with the post type you want to reset.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Change where Yoast Meta box is positioned on all pages/posttypes’ is closed to new replies.