Facebook share link: specify image and custom message shown in post

8,041

Facebook uses OpenGraph to determine what the page is about if those details are blank it will harvest other elements of the page. So if you want custom descriptions and images used then ensure that whatever page is being linked has the following code in the <head></head>.

For example:

<meta property="og:locale" content="en_GB" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Page Title Here" />
<meta property="og:description" content="Page Description" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:site_name" content="Example" />
<meta property="og:image" content="http://www.example.com/image-here.jpg" />
Share:
8,041

Related videos on Youtube

karancan
Author by

karancan

Updated on September 18, 2022

Comments

  • karancan
    karancan almost 2 years

    In my web application, I am allowing users to share their affiliate link to Facebook. I am currently doing this using this URL:

    <a target="_blank" onclick="return !window.open(this.href, 'Facebook', 'width=640,height=500')" href="http://www.facebook.com/sharer/sharer.php?u=[App_Link]">
    

    This results in a pop-up like this:

    enter image description here

    I want to be able to enhance this in two ways:

    1. Specify the image that is shown along with this custom post (the company logo)
    2. Specify a custom sentence or two in the Say something about this... text box

    Are one or both of these possible?

  • karancan
    karancan over 9 years
    Any ideas about how I can put in custom text in the Say something about this... box?
  • rink.attendant.6
    rink.attendant.6 almost 9 years
    @karancan Pre-filling the user message box is a violation of Facebook Platform Policy, 2.3 so I wouldn't imagine that Facebook provides a way to do that. A related topic: stackoverflow.com/a/5023658/404623