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.

2 Answers 2


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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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