0

I installed WordPress SEO a couple of days ago and have the Open Graph tags ticked, and they are all displaying fine apart from the page description. Should this be appearing, and am I correct in saying it will be automatically taken from the first couple of paragraphs?

Now I understand the reason for not having automatically generated Meta Descriptions, but right now when we post our articles on Google+, only the page title is being pulled through, so the post looks a little blank.

Is there anyway to get the opengraph description tags to work?

4
  • Is there an og:description in the source code of your post?
    – Sven
    Commented May 29, 2013 at 6:55
  • Nope, take a look at an example post: onedirection.net/…
    – pixelkicks
    Commented May 29, 2013 at 10:35
  • Did you set a Meta Description within the Yoast WordPress SEO Widget below your content?
    – Sven
    Commented May 29, 2013 at 10:49
  • No Sven, a lot of our posts don't have a Meta description set. But I was under the impression that the OG description should be auto-generated from the first 50-100 or so words? Or is there a way to do this? I understand the reasons for Yoast not wanting to auto-generate meta descriptions this way, but thought the OG descriptions should be ok this way.
    – pixelkicks
    Commented May 29, 2013 at 15:32

1 Answer 1

0

Okay, now I'll try to answer your question, but first a quote from the Yoast SEO Guide:

Some plugins, most specifically the All in One SEO plugin, use so called “automated descriptions”. They use the first sentence of a post to fill the meta description by default. That’s not very smart. That first sentence might be an introductory sentence which has hardly anything to do with the subject.

Thus, the only well written description is a hand written one, and if you’re thinking of auto generating the meta description, you might as well not do anything and let the search engine control the snippet… If you don’t use the meta description, the search engine will find the keyword searched for in your document, and automatically pick a string around that, which gives you a bolded word or two in the results page.

But perhaps you can specify at least a default custom template for your meta descriptions: Go to SEO › Title & Metas and set up an Meta description template. You'll find a lot of variables like %%sitedesc%% or %%excerpt%% within the Help tab.

enter image description here

As I know, your aim is to display the description on Google+ and Facebook. You can also specify these descriptions in detail (recommended) within the Yoast WordPress SEO Widget:

enter image description here

UPDATE: Check the class-opengraph.php file within the frontend folder of the plugin. What you'll need is something like this:

if ( $ogdesc && $ogdesc != '' ) { // check if there is a custom description
    if ( $echo !== false )
        echo "<meta property='og:description' content='" . esc_attr( $ogdesc ) . "'/>\n";
    else
        return $ogdesc;
} else { // take the excerpt as fallback description
    echo "<meta property='og:description' content='" . esc_attr( strip_tags( get_the_excerpt() ) )  . "'/>\n";
}

UPDATE 2: Simply add the following filter at the bottom of your function.php (so you'll be able to update the plugin):

function add_yoast_opengraph_description( $str ) {
    if ( $str == '' )
        return strip_tags( get_the_excerpt() );

    return $str;
}
add_filter( 'wpseo_opengraph_desc', 'add_yoast_opengraph_description' );

FYI: I noticed that it will take some time (sometimes) till meta descriptions will show up within social networks.

3
  • Thanks for that. However if I choose to enter something in the "Meta description template" on the "Post Types", this is used for the Meta Description as used by Google and other search engines, and not just for the OG tags. I'm happy not to auto-populate the Meta Descriptions and leave Google to choose the snippets it shows (unless we add a manual description), however I'd like the OG description to be auto-populated. From what I'm gathering now I don't think that's possible?
    – pixelkicks
    Commented May 30, 2013 at 8:24
  • @Buckers Perhaps you can check the latest version (1.4.8) of the plugin where they improved the frontpage OpenGraph tags...
    – Sven
    Commented Jun 20, 2013 at 20:56
  • 1
    Hi Sven, the functions.php edit is great, so I'll tick you up. Will also be taking a look at the new 1.4.8 version right now. Thanks.
    – pixelkicks
    Commented Jun 21, 2013 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.