BestOldCommercials.com is one of my casual hobby blogs that I enjoy posting to from time to time. Over the past couple of years, it’s slowly been gaining a modest Facebook presence so I’ve started posting every new post to the Old Commercials Facebook page.

The problem I’ve had with this is that when I grab the URL and paste it into Facebook, it either grabs the incorrect image and often doesn’t even suggest the one that I want.

In my case, this being a WordPress blog, I wanted Facebook to grab the “Featured” thumbnail image. It would suggest putting the logo, a static banner ad, the “relevant video” thumbnails, or even nothing at all… anything but the actual posts image when really what I wanted is this to auto-magically happen:

Facebook Showing Wrong Images from URL

Try it for yourself and see which image Facebook tries to use for one of your own URLs – paste a URL from your own website into a Facebook post and see which image Facebook suggests. It very well might get it the first time, but chances are it probably won’t.

Why is this important? Not only does this make posting your own content to Facebook frustrating, it also means that when others want to share your website they’re not going to get the right image, either. At best, they’ll link to the wrong image (decreasing relevant clicks) or, at worst, decide not to share your content at all.

How to Tell Facebook which Image You Want

This little piece of code right here will do the trick.

[content_box type=”without-header” text_color=”dark” color=”default”]

<link rel="image_src" href="http://www.domain.com/image/path/picture.jpg" />

[/content_box]

You can feasibly put this anywhere above the content, but ideally you’ll want to put this code in your tags.

If your site has dynamic content, you will want to insert the token or piece of code that will pull this image URL into the href tag.

In my particular instance using WordPress, I wanted Facebook to grab the Featured Image from whatever post I was working with. To do this, go into your Theme or Child Theme, the Post page and include the script with a Featured Image token in place. For me, it went like this:

[content_box type=”without-header” text_color=”dark” color=”default”]

<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<link rel="image_src" href="" />
<?php endif; ?>

[/content_box]

I added the code… why is Facebook STILL showing the wrong image?

Facebook caches some images. If you have the correct tag on your site but it still isn’t working, try going to the Facebook Debugger, typing in your URL and clicking the “Debug” button. Once it loads, hit the “Fetch new scrape information” button at the top. That should do the trick.