Galaxy Santa

Dragnet for Santa

Narr: Ladies and gentlemen: the story you are about to hear is false. Only the names are true, to protect this author from being accused of making up strange names. This is the city: Los Angeles,...

R. L. Copple's Blog

Getting FB to Show the Right Photo in WordPress

Sharing a drinkFacebook used to allow one to cycle through photos from a shared link, giving the poster control over which imaged showed, or allowed one to not show a photo at all but keep the graphic link. For some unexplained reason, this feature was lost in an update some time ago. Now a poster has absolutely no control over the selection of  a site’s photo in their link, usually pulling one from an unrelated article. Very frustrating.

Today I finally did some research and found one way to re-activate that feature. Figuring others would want this information, I decided to post it here and share it on Facebook.

This works on my WordPress site, this blog (version 3.0.3–yes, I need to update). The concept should work on other sites if you can add to the webpage’s meta data. What needs to be added is the following metadata link in the webpage’s <head> area: <meta property=”og:image” content=”image weblink here” /> For WordPress there is an easy way to do this for an individual post.

Once logged in to your admin page on the blog, and on the “add new post” or “edit a post” page, you’ll see under the post entry window a section labeled “Custom Fields.” Click the “Enter new” link. In the “name field,” enter: og:image. In the content field, enter the full web-link to your image. You can find that address if you have inserted it into your post by right-clicking the image in the post entry field and select “Copy image address” from the menu. Then paste it into the content field of your new entry.

Once published, share on Facebook as usual. You should now see the old arrows allowing you to cycle through available images, one which should be your post photo.

You’re welcome!

Update #1:

Apparently Facebook’s photo memory is limited when it allows you to choose a photo. This method does allow the option (currently, they could change that at any time) to select multiple photos from the referenced site, but there is no guarantee that the post’s photo will be included among them. In the case of this post, the photo above wasn’t in the choices I had, so I selected my mug shot. Better than a totally unrelated photo like the covers of one of my books, but not what I had hoped. We’ll see how it goes with future posts.

Update #2:

After some more research, I’ve discovered that Facebook has a sub-site that handles this, and though the above custom fields seems to indicate it will add that text into the metadata, apparently it doesn’t upon reviewing the source code, even though it seems to force Facebook to allow a choice of images instead of forcing you to take what it gives you. No, the real solution is to install a plug-in that makes it easy to output that data automatically, or add in the needed code in the theme’s function.php file to automatically set the featured image to be output as the image Facebook picks up.

Being geeky, I fiddled with the code of the file, and after some failed attempts, got it to work. You, however, may want to take the simpler route by installing one of two plug-ins that will do the job. I’ve not tried either of those so I can’t tell you how well or easy they are to work with.

Rather than regurgitating that article with the information on how to do that here, I’ll point you to the site that I found to be the most help on this topic: How to Add Facebook Open Graph Meta Data in WordPress Themes

The only note on this is to make sure your original file is bigger than 200px x 200px, but not more than 8 MB. Otherwise you’ll get errors from Facebook.

There you go! Now I should have the right image post to Facebook each time.

About R. L. Copple
R. L. Copple enjoys a good cup of coffee and a fun story. These two realities and inspiration from the likes of Lester Del Ray, J. R. Tolkien, C. S. Lewis, among others, caused him to write his own science fiction and fantasy stories to increase the fun in the world and to share his fresh perspective.
This entry was posted in Writing Tips and tagged , , , , . Bookmark the permalink.

One Response to Getting FB to Show the Right Photo in WordPress

  1. Pingback: Adding a Featured Image in Blogger That Will Show Up on Facebook | R. L. Copple's Blog

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Comments will be closed on November 15, 2019.

For spam detection purposes, please copy the number 7182 to the field below:

  • Categories

  • Past Musings

  • Titles

  • Hero Game

    Second book in The Virtual Chronicles. A superhero space adventure!

  • Mind Game

    Mind Game Cover

    First book in The Virtual Chronicles. Virtual reality has never been so real!

  • Reality’s Fire

    Third book in The Reality Chronicles. The exciting finale goes to Hell and back.

  • Reality’s Ascent

    Reality's Ascent Cover

    Second book in The Reality Chronicles. An adventure with consequences.

  • Reality’s Dawn

    First book in The Reality Chronicles. 15 adventures of Sisko to enjoy!

  • Ethereal Worlds Anthology

    25 short stories and flash fictions written over five years by R. L. Copple.

  • Strange Worlds of Lunacy

    Let's go there. It's a silly place. Two flash fictions in this anthology: "Shake, Rattle, and Roll," and "Baby Truth."