• How to i auto copy all my Yoast Meta description to Schema Post Meta Fields.
    I have more then 1000 posts, so manually will west my time.
    Thanks

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

    (@hishaman)

    You don’t need to copy the fields, you just need to use the Schema Generator to pull Title and Description from Yoast SEO post meta.

    Please, follow the steps mentioned here.

    Or you can use this filter in your Theme’s functions.php file:

    add_filter( 'schema_output', 'schema_wp_override_description_yoast_seo_5636346455' );
    /*
    *	Pull Schema Title and Description values from Yoast SEO 
    */
    function schema_wp_override_description_yoast_seo_5636346455( $schema_output ) {
    	
      // get Title (Headline) value from Yoast SEO post meta
    	$headline = get_post_meta( get_the_ID(), '_yoast_wpseo_title', true);
    	
    	// get Description value from Yoast SEO post meta
    	$desc = get_post_meta( get_the_ID(), '_yoast_wpseo_metadesc', true);
    	
    	// override the values in schema output
    	$schema_output["headline"]    = $headline;
    	$schema_output["description"] = $desc;
    	
    	// return our schema array
    	return $schema_output;
    }
    Thread Starter S o f t f u l l y

    (@softfully)

    Thank you very much for your quick response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Yoast Meta description to Schema Post Meta Fields’ is closed to new replies.