-1

I have created an application on facebook which sends the wall post on user registeration the wall post is working as expected but i am facing the strange issue when wall post is displayed in generalized form it displays my server path instead of caption and name i have used in wall post see this pictureenter image description here

when i visit the posts individually it displays perfect with caption and name.

Code Prank
  • 4,209
  • 5
  • 31
  • 47

1 Answers1

2

Facebook fetches meta data from a page when people share the link. Therefore you can add some in your page for the case.

First of all, at least add "og:title", "og:description" and "og:image" to your page. Like below:

<head>
    <meta charset="utf-8"> 
    <title>title</title>
    <meta property="og:title" content="title" />
    <meta property="og:description" content="the description about your page" />
    <meta property="og:image" content="http://domain.com/images/logo.jpg" />
</head>

then go to http://developers.facebook.com/tools/debug and type in the url of your page to see what facebook fetched.

Edison Chuang
  • 2,911
  • 4
  • 26
  • 28
  • my wall post is generated from php sdk when user visits the app after oauth permissions the users data is saved in database and the wallpost is generated after that he is redirected to welcome page... how can i put meta tags in php file? – Code Prank Dec 05 '12 at 05:43
  • 1
    I know you posted a message via sdk. However, In the picture of your question. It is a link which has been *shared* on facebook. It isn't the individual wallpost you saw. Facebook just displays information about the page that people shared. If the page doesn't provide any extra information. The url would be left. You can manually paste url to you facebook status then you will get same thing. – Edison Chuang Dec 05 '12 at 07:23
  • Yeah i got it working... I have put these meta tags in page where it is redirecting and it worked. But still minor problem is left which is it still showing servername instead of server path beneath the name in post. how can i remove it or change it to my text as we do in simple wall posts? – Code Prank Dec 05 '12 at 07:27
  • servername?? Did you mean domain in the gray? It can't be removed. It be displayed on purpose of helping people to know where he/she will go after click on the link. – Edison Chuang Dec 05 '12 at 07:38
  • yeah that domain name.... i have a requirement to change that because i am working for a client who have its product and he is launching facebook app which is hosted on my server. Is there any way to fix it out? – Code Prank Dec 05 '12 at 07:49
  • Call the IT guy to do DNS config. Let client's domain points to your server. – Edison Chuang Dec 05 '12 at 08:00