Facebook Share Multiple Images (og:image tags)

Add Multiple Images to Facebook Share Link

Advertisement

You might be wondering how Facebook choses which thumbnail images to show when someone shares a link on Facebook. It might seem random, but there is a way for you to control which images Facebook uses.

Facebook’s Open Graph allows you to add <meta> tags to the <head> section of your site. One of these <meta> tags is the og:image tag. It will look something like this:

<meta property='og:image' content='http://www.domain.com/path/to/image.jpg' />

It is possible to add multiple og:image tags to a page. For each og:image tag you add, Facebook will add that image to the list of available thumbnails to use each time the page is shared.

Facebook Share Multiple Images (og:image tags)
29 og:image tags gives us multiple thumbnails to choose from in the Facebook share post box.

og:image Tag on WordPress Sites

If you’re using WordPress, there’s a great SEO plugin that will add 1 og:image tag per page to your WordPress posts & pages. It’s a great place to start, but it won’t fix your problem of multiple images for a Facebook share.

You can open up your header.php file, and write a custom function that pulls all the images attached to that post/page, and inserts them all into their own og:image <meta> tag.

However, sometimes Facebook can scrape your site & find many of your images on its own. It just depends on how much control you want.

Advertisement

Dave Warfel

Bio coming soon…

6 thoughts on “Add Multiple Images to Facebook Share Link

  1. Hi,
    The exact thing in need to be implement in my project but in PHP.
    How to implement in Core PHP ?

    Any one reply with some tips or tricks or some code will be appreciable.

    Thanks,
    -John

  2. Hi John,

    To my knowledge, Core PHP is a framework, not a CMS, correct? So, are you using a specific CMS, or have you built a custom CMS using Core PHP?

    If you’re using a custom PHP solution, can you post a snippet of your code that pulls in a single image for a page/post on your website?

    I’m not a PHP expert by any means, but will try my best to point you in the right direction.

  3. I don’t know if it’s just me or if perhaps everybody else experiencing issues with your
    website. It seems like some of the written text within your content are running off the screen. Can someone else please comment and let me know if this is happening
    to them too? This might be a issue with my internet browser because I’ve had this happen previously.
    Cheers

  4. Thanks but is there a way to make the images show up as a gallery? Like when you upload multiple photos to Facebook and it shows about four with a + button for more.

Leave a Reply

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