• Resolved Singh

    (@preetji)


    I’ve been using the Schema for quite a long time. This is a perfect plugin for my usage except one bug. It is not picking up Meta Description from Yoast Plugin. Instead, the description is curated from the first 2-3 lines of my article.

    For further investigating this issue, you may [ redundant link removed ]. I would be Thankful if you guys can provide a working solution to this problem.

    Keen Regards.

Viewing 1 replies (of 1 total)
  • Plugin Author Hesham Zebida

    (@hishaman)

    By default, the Schema plugin will grab the first paragraph and use part of it as a description. However, you can override that to use any other source for the description (example: Yoast SEO description post meta value)

    Here is a working example code that you can use:

    add_filter( 'schema_output', 'schema_wp_override_description_yoast_seo_12345' );
    /*
    *	Override Schema description value with Yoast SEO description
    */
    function schema_wp_override_description_yoast_seo_12345( $schema_output ) {
    	
    	// get description value from Yoast SEO post meta
    	$desc = get_post_meta( get_the_ID(), '_yoast_wpseo_metadesc', true);
    	
    	// override the value in schema output
    	$schema_output["description"] = $desc;
    	
    	// return our schema array
    	return $schema_output;
    }

    P.S. This code can be added to your Theme’s functions.php file. Once you add the code, go to Schema > Types > edit any of the types you have and save it (this will flush the saved schema markups so changes will take effect)

    I hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Schema Not Picking Meta Description from Yoast SEO data’ is closed to new replies.