WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Change where Yoast Meta box is positioned on all pages/posttypes (9 posts)

  1. greensplash
    Member
    Posted 2 years ago #

    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/

  2. greensplash
    Member
    Posted 2 years ago #

    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' );
    }

  3. greensplash
    Member
    Posted 2 years ago #

    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' ) );

  4. zandercent
    Member
    Posted 2 years ago #

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

    thanks

  5. Junaid Bhura
    Member
    Posted 1 year ago #

    + 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?

  6. rpetersnmt
    Member
    Posted 1 year ago #

    Try adding this to your functions.php:

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

  7. Junaid Bhura
    Member
    Posted 1 year ago #

    Omg, this works! Thanks, man!

  8. jodiw
    Member
    Posted 1 year ago #

    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.

  9. bniblett2013
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic