Meta title bug with SEO plugins

This topic contains 16 replies, has 4 voices, and was last updated by  Rich B 9 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #30008

    Rich B
    Free User
    Post count: 36

    Still having the same issue, tried Michaels solution and its still not working 🙁

    #30056

    Rich B
    Free User
    Post count: 36

    Ok found a solution, this only works if you have ticked the option to force Yoast to re-write the head meta.

    Essentially the code below takes the original geo injected output from yoast for the homepage, removes it and replaces it with the actual yoast meta:

    
    
    // Remove default geo_homepage meta and replace with yoast
    function yoast_get_home_title() {
      return get_bloginfo('name');
    }
    function yoast_get_home_description() {
    	$homeid = get_option('page_on_front');
    	return get_post_meta($homeid, '_yoast_wpseo_metadesc', true);
    }
    function yoast_get_home_url() {
    	return get_bloginfo('url');
    }
    function geodir_wpseo_homepage_meta() {
        global $post;
    
        if ( is_home() ) {
    		add_filter('geodir_add_meta_keywords' , '__return_false', 1) ;
    		add_filter( 'wpseo_title', '__return_false', 1 );
    		add_filter( 'wpseo_metadesc', '__return_false', 1 );
    		add_filter( 'wpseo_canonical', '__return_false', 1 );
    		add_filter( 'wpseo_title', 'yoast_get_home_title', 2 );
    		add_filter( 'wpseo_metadesc', 'yoast_get_home_description', 2 );
    		add_filter( 'wpseo_canonical', 'yoast_get_home_url', 2 );
        }
    }
    add_filter( 'wp_head', 'geodir_wpseo_homepage_meta', 1 );
Viewing 2 posts - 16 through 17 (of 17 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket