WordPress.org

Ready to get started?Download WordPress

Forums

WP Facebook Open Graph protocol
No meta description with Yoast WordPress SEO plugin (5 posts)

  1. colouro
    Member
    Posted 1 year ago #

    Yoast WordPress SEO adds the description tag, but WPFOG does not add og:description.

    My problem is that I do not use any excerpt or post content. My posts are only from custom fields.

    Maybe someone knows the solution?

    http://wordpress.org/extend/plugins/wp-facebook-open-graph-protocol/

  2. colouro
    Member
    Posted 1 year ago #

    If anyone wants to know how to get around this problem, so I did the following:

    Line 130: replaced the "is_singular()" to "!is_page()"
    Line 134: wrote $wpfbogp_description = "<YOUR_TEXT>";

    I used: get_the_title($post->ID) to get the post title.
    get_field("<FIELD_NAME>", $post->ID ) to get custom field value ( advanced custom fields plugin )

    Conclusion: if it is page, then it uses site description, if it is single post, then it uses custom description...

  3. Fox505
    Member
    Posted 1 year ago #

    Odd, I am having the same issue. I will try your fix.

  4. OldGrumpyDE
    Member
    Posted 1 year ago #

    That problem stems from the regex used to locate the SEO description. I fixed it by changing the regex in function wpfbogp_callback() to actually work ;)

    $description = preg_match( '#<meta name="description" content="(.*)" />#', $content, $description_matches );

    and

    $content = preg_replace( '#<meta property="og:description" content="(.*)"/>#', '<meta property="og:description" content="' . $description_matches[1] . '"/>', $content );

  5. Chuck Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    The new Beta addresses the filtering issues some sites were having but needs more testing as it fixes a lot and has a lot of additions and changes. Just need some more time to test and should be up in near future.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic