WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I'm posting a link for a WordPress page or post on a Facebook Page wall (using the "Post a link" option), I want Facebook to offer up, as choices, (a) all images which are embedded in the linked page/post as well as (b) a set of default images (in case the page/post in question has no embedded images).

What I've done is add (to wp_head) several candidate images in separate link rel="img_src" tags.

The problem is that these link rel tags appear to override any images that are actually embedded in the page/post.

Any advice would be appreciated.

share|improve this question

You need to use a Plugin that manipulates the data sent via the Facebook Open Graph Protocol, e.g. Facebook Opengraph. There are several others, also.

Related Posts

share|improve this answer
Thank you, Chip. I'll check it out. – Jeff Cohan Jul 10 '11 at 18:56

When you're adding the images in the head, do a query on the posts ID to find posts that are of the post type attachment with the parent ID equal to that of the current post. Then use these attachments to generate the image URLs in your header via wp_get_attachment_image_src .

This way the 'candidate' images will always be images attached to the current post

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.