WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Post meta description is not shown on facebook when sharing link (11 posts)

  1. nikhu07
    Member
    Posted 2 years ago #

    Hi,
    My site's address is http://svolze.com
    When I try to share my posts on my facebook profile it shows no excerpt/description. While on search engine, google+ and other sites display it correctly. In my header I found that my theme does not contain meta description tag. Should I put it? Though I am using yoast SEO plugin the problem persists. I have tried putting the following codes still it can't help me

    <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <meta name="description" content="<?php the_excerpt_rss(); ?>" />
    <?php endwhile; endif; elseif(is_home()) : ?>
    <meta name="description" content="<?php bloginfo('description'); ?>" />
    <?php endif; ?>
    <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <meta name="description" content="<?php the_content_limit(200)?>" />
    <?php endwhile; endif; elseif(is_home()) : ?>
    <meta name="description" content="<?php bloginfo('description'); ?>" />
    <?php endif; ?>
    <meta name="description" content="<?php
     // if home page output blog name and description
     if (is_home()) { bloginfo('name'); echo " - "; bloginfo('description');}
     // if single page output either excerpt if available or post title
     elseif (is_single()) {
     $custommeta = get_post_meta($post->ID, "MetaDescription", true);
     // checks ot see if the custom field MetaDescription is not empty
     if ($custommeta !=='') {echo $custommeta;}
     // check if excerpt exists for the post and output it if it does
     elseif (!empty($post->post_excerpt)) {the_excerpt();}
     // if there's no custom field or excerpt output the post title
     else {single_post_title('', true);}
     }
     // if category page output the category description
     elseif (is_category()) {echo category_description();}
    
     // if it's any other page display this generic description
     else { echo 'Add your own generic site description here';}
     ?>"
    />

    Please help me with this problem.

  2. ChristiNi
    Member
    Posted 2 years ago #

  3. nikhu07
    Member
    Posted 2 years ago #

    I have tried all but that is not helping me..its still not showing the excerpt after sharing.

  4. ChristiNi
    Member
    Posted 2 years ago #

    Hi nikhu07,

    Each plugin may have a different way of handling the post excerpt and might also depend on your theme. Which plugin and theme are you using please?

    Thanks!

  5. nikhu07
    Member
    Posted 2 years ago #

    Thank you cristini, I have sorted it out..its the problem with my permalink on wordpress. now its catching my excerpt correctly.

  6. ChristiNi
    Member
    Posted 2 years ago #

    Fantastic nikhu07!

    Glad you were able to resolve this. If you have time, please let us know what the issue was with the permalinks and how you resolved it so anyone else having a similar issue can try that as well.

    Thanks!

  7. nikhu07
    Member
    Posted 2 years ago #

    Actually, I'm using custom permalink and in creating it, I forgot to place '/' That's why its not catching the excerpt. Now its fine.

  8. ChristiNi
    Member
    Posted 2 years ago #

    Thanks for the update nikhu07! Glad to hear everything is working fine now.

  9. Ecyanboo
    Member
    Posted 2 years ago #

    Hi

    I also face the same problem. I don't know why, since I installed Yoast SEO plugin, the description of my blog didn't appeared on facebook when my post shared.

  10. urlogos
    Member
    Posted 1 year ago #

    I been getting this same problem... to explain Nik solution. If you got to wordpresses Settings > Permalink > make a change to the permalink structure if will start to recognize the breaks between posts.

    I wish I have more to add here still searching for the root of this problem? I will post back when I figure it out.

  11. sureshHARDIYA
    Member
    Posted 1 year ago #

    hello, I am facing similar problem. when i share any post in my website, the share only shows the meta description of my site, not the post i want to share

    http://www.nepalisanchar.com/?p=257

    this is the site, u check on any posts, and if i share using facebook or any other, the share only shows meta description not the summary of the post i share

Topic Closed

This topic has been closed to new replies.

About this Topic