Search code examples
jqueryfacebookfacebook-opengraphsocial-likes

Does facebook opengraph works on localhost?


Maybe a stupid question but I never integrated social like butons before. I'm using social-likes plugin https://github.com/sapegin/social-likes and I would like to add an image and description via facebook opengraph og tags. Now I did exactly what is described in the docs and placed the og metatags in my head section.

<meta property="og:type" content="website">
<meta property="og:url" content="<?php echo URL ?>">
<meta property="og:title" content="{Mollamaya">
<meta property="og:description" content="Hier moet een beschrijving komen... ">
<meta property="og:image" content="<?php echo URL ?>public/images/logo/facebook.png">

I'm not seeing the image nor any other content from the metatags. Could this be because opengraph does not work on localhost? do I need to load any additional scripts for opengraph to work? thank you!


Solution

  • Facebook Open Graph requires that a domain should be publicly available. Now, if you're testing Facebook Open graph in localhost, you might need to use proxylocal so that your local server will be publicly available.