• Resolved zakoops

    (@zakoops)


    Hi,

    Unless I’m mistaken, Jetpack does not support the standard description’s meta tag for a blog post or page.

    …not the “og:description” Open Graph meta tag but that basic one:

    <meta name="description" content="Description for post or page contents that appears in Google search.">

    How could Jetpack support Open Graph meta tags but dismiss the basic description’s meta tag —the one that so many WordPress themes also do not consider or support?

    Yes many plugins exist for that omission but that’s another burden.

    Such description’s meta tag would be provided on a per post or par page basis.

    https://ww.wp.xz.cn/plugins/jetpack/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Jetpack does not support the standard description’s meta tag for a blog post or page.

    That’s correct. As you’ve noticed, Jetpack includes Open Graph Meta tags. We add these tags whenever you activate the Sharing module or the Publicize module. These tags allow Social Networks like Facebook, LinkedIn, Google+, or Pinterest to gather information about a post and build a post preview. Without those tags, Social Networks like Facebook will in some cases reject a post that’s been posted via an app, like Publicize.

    We also add Twitter Meta Cards tags, since Twitter requires its own set of tags.

    These Social Networks do not rely on the description meta tag, though. That’s why we didn’t add it to the list of tags added by Jetpack.

    Since this tag is mostly useful for Search Engines, it’s often included in Search Engine Optimization plugins, like Yoast SEO. If you’re interested in adding the tag to your site, I’d recommend using this plugin.

    Another alternative would be to extend Jetpack’s default list of tags, and add your own, based on the existing og:description tag. To do so, you can paste the following in your theme’s functions.php file, or in a functionality plugin:

    /**
     * Add a new tag, named description, matching the existing og:description tag.
     *
     * If og:description doesn't exist for a post/page, do not add any new tag.
     *
     * @filter jetpack_open_graph_tags
     * @uses isset
     */
    function jeherve_custom_desc_tag( $tags ) {
    	if ( isset( $tags['og:description'] ) ) {
    		$tags['description'] = $tags['og:description'];
    	}
    	return $tags;
    }
    add_filter( 'jetpack_open_graph_tags', 'jeherve_custom_desc_tag' );
    
    /**
     * Replace property="description" by name="description" in the new tag.
     *
     * Jetpack uses property="thing" as template for its Meta tags,
     * because it's built to output OG Tags. However, we we want to output a general tag here.
     *
     * @filter jetpack_open_graph_output
     * @uses str_replace
     */
    function jeherve_desc_tag_output( $og_tag ) {
    
    	// Replace property="description" by name="description"
    	$og_tag = str_replace( 'property="description"', 'name="description"', $og_tag );
    
    	return $og_tag;
    }
    add_filter( 'jetpack_open_graph_output', 'jeherve_desc_tag_output' );
    Thread Starter zakoops

    (@zakoops)

    Hi Jeremy,

    I thank you for your reply —quite comprehensive for context and possible solutions.

    I decided for the alternate solution. Therefore I grabbed Sublime Text and extended Jetpack’s default list of tags in functions.php file, as you have proposed (in a child theme though).

    And this works perfectly!

    So thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Feature Request: description meta tag’ is closed to new replies.