WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Meta Description now displaying %%excerpt%% (3 posts)

  1. oomskaap
    Member
    Posted 1 year ago #

    My scenario is that i use a plugin that generates 1 latest search term at the bottom of the post, lets say "big red car". So in my header if i have

    <meta name="description" content="<?php the_excerpt_rss(); ?>" />

    google will display it in the search results as

    Big Car
    http://www.sitename.com/category/cars
    big red car
    -----------------------------------

    The results is i want to remove that code and let Yoast SEO do all the work. I want to display the Focuskeyword, and also the auto generated search term the other plugin throws out. Essentially:

    Big Car
    http://www.sitename.com/category/cars
    focuskeyword, big red car

    So i delete the <meta name="description" content="<?php the_excerpt_rss(); ?>" /> from my head and let Yoast SEO do it.

    In the SEO post titles, i add "%%focuskw%% %%excerpt%%" at the meta description. But i see that it does not recognize the auto generated text. It only shows the focuskeyword.

    Is this because the auto generated term is not hard coded into the post itself? because its not. But <meta name="description" content="<?php the_excerpt_rss(); ?>" /> picks it up as if it were. How can i get Yoast SEO to pick it up as well?

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. oomskaap
    Member
    Posted 1 year ago #

    Also note if i do use them together, yoast post titles and also the
    <meta name="description" content="<?php the_excerpt_rss(); ?>" /> in my header, the result is:

    <!-- meta tags -->
    <meta name="description" content="big red car" />
    
    <!-- This site is optimized with the Yoast WordPress SEO plugin v1.1.7 - http://yoast.com/wordpress/seo/ -->
    <meta name="description" content="focuskeyword"/>

    Then, google does not pickup the second meta desc, and display this post as

    Big Car
    http://www.sitename.com/category/cars
    big red car

    Is some code like
    <meta name="description" content="<?php focuskeyword(); ?>" /> , <?php the_excerpt_rss(); ?>" /> possible? because that would work.

  3. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    There's no use to have two meta descriptions, just let my plugin handle it...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic