Primary Taxonomy for Post

This post is super old but I’ll post my solution here in case anyone else stumbles across this.

If you’re using Yoast SEO you can hook into their existing implementation (they do this already for categories).

function add_variety_primary_term_taxonomy( $taxonomies, $post_type, $all ) {
    if( $post_type == 'product' && isset( $all['my_custom_tax'] ) ) {
        $taxonomies['my_custom_tax'] = $all['my_custom_tax'];
    }

    return $taxonomies;
}

add_filter( 'wpseo_primary_term_taxonomies', 'add_variety_primary_term_taxonomy', 10, 3 );

Also, your custom taxonomy must have ‘hierarchical’ => true for this to work.

Good luck!

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino