Title: [Plugin: Facebook] og:image  missing
Last modified: August 20, 2016

---

# [Plugin: Facebook] og:image missing

 *  [Mark](https://wordpress.org/support/users/marksda1/)
 * (@marksda1)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-facebook-ogimage-missing/)
 * I was previously using an open graph plugin that had an algorithm for picking
   the image to send to Facebook in open graph. It looked first to see if there 
   was a featured image for the post/page, then if not to see if there were any 
   images in the post/page itself, and if not it then it fell back to a default 
   image specified in the settings.
 * The Facebook plugin is (at least for me) not consistent in this regards. For 
   posts, I’m not sure if it’s picking the first image or the featured image (for
   me they are usually the same, but it is at least passing an image. For pages 
   however, there’s no image value being passed. I see this both from looking at
   the resulting code as well as the debugger. Here’s [a page from my site as an example](http://www.marktisdalephotography.com/artist-statement/),
   when I run it through the debugger it points out the image is missing. Is there
   a setting somewhere that controls this or does the plug-in not look for images
   on pages?
 * If not, could a future iteration be updated to A) Include images on pages and
   B) allow us to set a default image for those instances when a page or post lacks
   any images?
 * Note, I’ve hard-coded the like button into my template, but even when I disable
   and turn on the Facebook plug-in like button, I still see the same behavior. 
   It’s the halfway problem I can’t get around easily. I could tell WordPress what
   og:image to pass but on posts it would be duplicated.
 * [http://wordpress.org/extend/plugins/facebook/](http://wordpress.org/extend/plugins/facebook/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Niall Kennedy](https://wordpress.org/support/users/niallkennedy/)
 * (@niallkennedy)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-facebook-ogimage-missing/#post-2844162)
 * The Facebook plugin outputs og:image values if a post type supports featured 
   thumbnails and a featured thumbnail exists for the post.
 * You can add your own default image by tapping into the `fb_meta_tags` [filter](http://codex.wordpress.org/Function_Reference/add_filter).
 *  Thread Starter [Mark](https://wordpress.org/support/users/marksda1/)
 * (@marksda1)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-facebook-ogimage-missing/#post-2844163)
 * So it appears only posts thumbnails are supported? Is there a reason pages are
   not supported? As I said, the previous plugin I was using was able to accomplish
   both tasks.
 * I’ll look at your link, and see if it’s something I can manage on my own in the
   interim but I don’t think it’s expecting much for Facebook’s own plugin to handle
   both Page and Post featured images. Joe User (and I likely fall into that camp
   myself) isn’t expecting to have to jump through hoops. Heck, how many posts have
   I read just for the support issues in this plugin that involved users unsure 
   how to even FTP into their site?
 * At any rate, thanks for the confirmation and for the link! I’ll see what I can
   make of it.
 *  [Gaerwn](https://wordpress.org/support/users/merllin/)
 * (@merllin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-facebook-ogimage-missing/#post-2844310)
 * Change in file /wp-content/plugins/facebook/fb-open-graph.php, this code (line
   150):
 * `else if ( is_page() ) {
    $meta_tags['http://ogp.me/ns#type'] = 'article'; $meta_tags['
   http://ogp.me/ns#title'] = get_the_title(); $meta_tags['http://ogp.me/ns#url']
   = apply_filters( 'rel_canonical', get_permalink() ); }
 * with this one
 * `else if ( is_page() ) {
    $meta_tags['http://ogp.me/ns#type'] = 'article'; $meta_tags['
   http://ogp.me/ns#title'] = get_the_title(); $meta_tags['http://ogp.me/ns#url']
   = apply_filters( 'rel_canonical', get_permalink() ); // page thumbnail if ( function_exists('
   has_post_thumbnail' ) && has_post_thumbnail() ) { list( $post_thumbnail_url, 
   $post_thumbnail_width, $post_thumbnail_height ) = wp_get_attachment_image_src(
   get_post_thumbnail_id( $page->ID ), 'full' ); if ( ! empty( $post_thumbnail_url)){
   $image = array( 'url' => $post_thumbnail_url ); if ( ! empty( $post_thumbnail_width))
   $image['width'] = absint( $post_thumbnail_width ); if ( ! empty($post_thumbnail_height))
   $image['height'] = absint( $post_thumbnail_height ); $meta_tags['http://ogp.me/
   ns#image'] = array( $image ); } } }
 * It worked for me.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Facebook] og:image missing’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/facebook_526fac.svg)
 * [Facebook](https://wordpress.org/plugins/facebook/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/facebook/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/facebook/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook/reviews/)

## Tags

 * [og:image](https://wordpress.org/support/topic-tag/ogimage/)
 * [picture/](https://wordpress.org/support/topic-tag/picture/)

 * 3 replies
 * 3 participants
 * Last reply from: [Gaerwn](https://wordpress.org/support/users/merllin/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-facebook-ogimage-missing/#post-2844310)
 * Status: not resolved