WordPress SEO (Yoast) add itemprop="description" to meta description
-
I would like to add itemprop=”description” to the meta tag description which is automatically generated by Yoast (trying to implement schema.org article markup). I’ve tried adding the following function:
function infinity_meta_schema() { if( class_exists( 'WPSEO_Frontend' ) ) { global $wpseo_front; $metadesc = $wpseo_front->metadesc( false ); echo '<meta itemprop="description" content="' . esc_attr( strip_tags( stripslashes( $metadesc ) ) ) . '" />' . "\n"; } } add_action( 'wpseo_head', 'infinity_meta_schema' );
This generates the meta description I want, but there is also another meta description there without itemprop=”description”.
How can I produce only one meta description with itemprop=”description” in it? How do I disable the default one?
Any advice would be appreciate it. Thanks.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘WordPress SEO (Yoast) add itemprop="description" to meta description’ is closed to new replies.