-1

hope you all are well, i need your help as i am facing an issue on my wordpress website when i post my website url on my facebook page it show an random image which i don't want please check this screenshot

In this image you easily understand which issue i am talking about, i want logo of website to be shown in place of space image, Please anyone helpme out of it , Thank you in advance

  • Does [this](http://stackoverflow.com/questions/19632323/default-website-image-for-social-sharing) help? You should be able to set it with a `` tag in your header (I assume you know how to edit your theme). Note that Facebook requires a certain size and aspect ratio (the image can't be really thin or wide); can't remember the limits on that though – Hobo Jun 07 '16 at 06:05

4 Answers4

0

You can use this Plugin to fix your issues https://wordpress.org/plugins/facebook-thumb-fixer/ or you can follow this http://www.wpbeginner.com/wp-tutorials/how-to-fix-facebook-incorrect-thumbnail-issue-in-wordpress/

If you not get any solutions, let me know. Thanks

  • actually when i search for these plugin on my dashboard these all are untested for website version so i didin't use these as it may harm website so – Shreya Mahajan Jun 07 '16 at 06:11
0

Try putting OpenGraph image tag like so

<meta property="og:image" content="link to your logo" />
Igor Yavych
  • 4,166
  • 3
  • 21
  • 42
0

You need to put open graph tags in your header.php. I usually use this combination:

<?php
    $theme = wp_get_theme();
    $screenshot_url = esc_url( $theme->get_screenshot() );
if ( is_home() ): ?>

<meta property="og:url"           content="<?php echo get_home_url(''); ?>" />
<meta property="og:type"          content="website" />
<meta property="og:title"         content="<?php echo get_bloginfo('name'); ?>" />
<meta property="og:description"   content="<?php echo get_bloginfo('description'); ?>" />
<meta property="og:image"         content="<?php echo $screenshot_url; ?>" />

<?php elseif( is_category() ):
    $cat_id = get_query_var('cat');
    $cat_name = get_cat_name($cat_id);
    $cat_desc = (category_description( $cat_id ) != '') ? category_description( $cat_id ) : get_bloginfo('description');    
?>

<meta property="og:url"           content="<?php echo get_category_link($cat_id); ?>" />
<meta property="og:type"          content="website" />
<meta property="og:title"         content="<?php echo $cat_name; ?>" />
<meta property="og:description"   content="<?php echo $cat_desc; ?>" />
<meta property="og:image"         content="<?php echo $screenshot_url; ?>" />

<?php else: ?>

<meta property="og:url"           content="<?php the_permalink(); ?>" />
<meta property="og:type"          content="website" />
<meta property="og:title"         content="<?php echo get_the_title(); ?>" />
<meta property="og:description"   content="<?php echo get_the_excerpt(); ?>" />
<?php if(has_post_thumbnail()):
    $url = wp_get_attachment_url( get_post_thumbnail_id() );
?>
<meta property="og:image"         content="<?php echo $url; ?>" />
<?php else: ?>
<meta property="og:image"         content="<?php echo $screenshot_url; ?>" />

<?php endif; ?>

<?php endif; ?>

I put separate OG tags for home, category and other pages, with a fallback to theme image (this prevents random image being selected).

Hope this helps.

dingo_d
  • 11,160
  • 11
  • 73
  • 132
  • i tried it but no success actually it showed as thumbnail images http://imgur.com/4x1eaZi – Shreya Mahajan Jun 07 '16 at 07:06
  • Then you must have some kind of plugin on your page that messes stuff up. Can you edit your post and show what you have in your tags when you place this code? – dingo_d Jun 07 '16 at 07:10
  • I don't have any specific post for the same and moreover i didn't use any plugin for social links – Shreya Mahajan Jun 07 '16 at 07:13
  • 1
    Just inspect any post with thumbnail, and look in the `` tag to see if there are maybe existing og tags there. Also you can use [Facebook Open Graph Debugger](https://developers.facebook.com/tools/debug/) – dingo_d Jun 07 '16 at 07:21
  • i used this tool and getting error "Facebook URLs cannot be crawled." – Shreya Mahajan Jun 07 '16 at 07:25
  • Check [this answer](http://stackoverflow.com/questions/12743175/facebook-urls-cannot-be-crawled) then. – dingo_d Jun 07 '16 at 09:54
0

Try this:

<meta property="og:image" content="<?php the_post_thumbnail(); ?>" />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:description" content="<?php the_content(); ?>" />
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:type" content="article" />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="article:published_time" content="<?php echo get_the_time(); ?>" />
<meta property="article:modified_time" content="<?php the_modified_date(); ?>" />
<meta property="article:author" content="<?php the_author(); ?>" />
<meta property="article:section" content="Featured" />
<meta property="article:tag" content="<?php the_tags(); ?>" />

http://happybloggerplaza.com/how-to-fix-thumbnail-image-facebook/ https://wordpress.org/plugins/facebook-thumb-fixer/other_notes/