WordPress.org

Support

Support » Plugins and Hacks » Post to Facebook Page – Suggestion

Post to Facebook Page – Suggestion

  • Josh-TWC
    Member

    @josh-twc

    I know a lot of people are using Yoast SEO and spend some time getting the Meta Description to be just right for search engines. I wanted to use the same description for the Facebook page post.

    Also many of my pages and posts content contain shortcode which was displaying in the FB post description. Another reason for wanting to use the SEO meta description.

    In the file fb-social-publisher.php at lines 239&240 + 250&251 I commented out the default caption and description code:

    // 'caption' => strip_tags( apply_filters( 'the_excerpt', get_the_excerpt() ) ),
    // 'description' => strip_tags( fb_strip_and_format_desc( $post ) ),

    And added this:

    'caption' => strip_tags( fb_strip_and_format_desc( get_post_meta($post->ID, '_yoast_wpseo_metadesc', true ) ) ),

    Maybe in a future update there could be a setting to use Yoast SEO Meta Description instead of the_excerpt or post content?

    http://wordpress.org/extend/plugins/facebook/

  • The topic ‘Post to Facebook Page – Suggestion’ is closed to new replies.