How to select an image for share on Facebook?

How to select an image for share on Facebook?

This is a tricky one.

First of all, head to this url provided by Facebook which is a tool where you see a lot of information regarding the images.

https://developers.facebook.com/tools/debug/og/object/.

There, type for example this url: https://incvice.com/head-first-programming-python-coffe-beans-html-page/.

Now click on “fetch new scrape information”.

You will see at some point the tag: “og:image”.

You need to specify an og:image tag in the of your web page.

An example:

1
2
<meta property="og:image" content="https://incvice.com/wp-content/uploads/2016/01/
head-first-python-coffe-beans.jpg" />

Put the same tag on your website. This should fix your issue.

You can do some tweaks in php if your images are unique and dynamic. Or just set a standard image.

For the og:image tag, the content values must not contain blank spaces, use %20 instead.
Also, you need to provide the full url, including http:// etc.

If you have questions, leave in the comments.

Add a comment: