SEOPress ist ein feines kleines Plugin mit großer Wirkung. Es lassen sich zu jeder Seite und zu jedem Beitrag die für SEO wichtigsten META Tags direkt in der EIngabemaske bearbeiten – und eine kleine Vorschau zeigt, wie die Seite in den Suchergebnissen angezeigt werden würde.
Das Plugin hat aber die Angewohnheit, sich vorzudrängeln. Zumindest wenn man ACF Felder nutzt kann es sein, dass die SEOPress Metabox vor den ACF Felder auftaucht. Das kann etwas lästig sein. Mit ein paar Zeilen Code lässt sich die SEOPress Metabox aber ganz einfach nach unten verschieben.
SEOPress unter die ACF Felder bewegen
/* move SEOPress meta box down */ add_action( 'add_meta_boxes', function() { global $wp_meta_boxes; $post_type = 'page'; // Get seopress meta boxes $seopress_meta_box = $wp_meta_boxes[$post_type]['normal']['high']['seopress_cpt']; $seopress_analysis_meta_box = $wp_meta_boxes[$post_type]['normal']['high']['seopress_content_analysis']; unset( $wp_meta_boxes[$post_type]['normal']['high']['seopress_cpt'] ); unset( $wp_meta_boxes[$post_type]['normal']['high']['seopress_content_analysis'] ); // Move it to 'advanced' location with 'low' priority. if ( empty( $wp_meta_boxes[$post_type]['advanced'] ) ) { $wp_meta_boxes[$post_type]['advanced'] = []; } if ( empty( $wp_meta_boxes[$post_type]['advanced']['low'] ) ) { $wp_meta_boxes[$post_type]['advanced']['low'] = []; } $wp_meta_boxes[$post_type]['advanced']['low']['seopress_cpt'] = $seopress_meta_box; $wp_meta_boxes[$post_type]['advanced']['low']['seopress_content_analysis'] = $seopress_analysis_meta_box; }, 99 );
Wenn die SEOPress Metabox gleich bei mehreren Content Typen (bzw. Custom Post Types CPT) unterhalb der ACF-Felder bewegen soll, muss der Code lediglich in einen entsprechenden foreach-Loop gekapselt werden. Die Variable ‚post_type‘ wird durch den Array ‚post_types‘ ersetzt:
/* move SEOPress meta box down */ add_action( 'add_meta_boxes', function() { global $wp_meta_boxes; $post_types = array('post','page','custon_post_type'); foreach($post_types as $post_type) { // Get seopress meta boxes $seopress_meta_box = $wp_meta_boxes[$post_type]['normal']['high']['seopress_cpt']; $seopress_analysis_meta_box = $wp_meta_boxes[$post_type]['normal']['high']['seopress_content_analysis']; unset( $wp_meta_boxes[$post_type]['normal']['high']['seopress_cpt'] ); unset( $wp_meta_boxes[$post_type]['normal']['high']['seopress_content_analysis'] ); // Move it to 'advanced' location with 'low' priority. if ( empty( $wp_meta_boxes[$post_type]['advanced'] ) ) { $wp_meta_boxes[$post_type]['advanced'] = []; } if ( empty( $wp_meta_boxes[$post_type]['advanced']['low'] ) ) { $wp_meta_boxes[$post_type]['advanced']['low'] = []; } $wp_meta_boxes[$post_type]['advanced']['low']['seopress_cpt'] = $seopress_meta_box; $wp_meta_boxes[$post_type]['advanced']['low']['seopress_content_analysis'] = $seopress_analysis_meta_box; } }, 99 );
In Anlehnung an „WordPress: Change meta box location“
https://deluxeblogtips.com/wordpress-change-meta-box-location/
Siehe auch „Moving meta boxes in admin“
https://wordpress.stackexchange.com/questions/166825/moving-meta-boxes-in-admin
Und auch hier: „How to reorder meta box position?“
https://wordpress.stackexchange.com/questions/57897/how-to-reorder-meta-box-position