WordPress Plugin: Open Graph Metatags for Facebook

Posted by & filed under Web development, Wordpress, Wordpress Plugins.

You can download my WordPress Plugin: Open Graph Metatags for Facebook clicking here.

What are Open Graph Metatags?

Open Graph is a protocol for customizing which information will be scrapped from your site, on Facebook sharing.

What does the plugin?

The plugin just adds the Open Graph metatags on your header, based on the title, content and thumbnail of your post.

How do I install de plugin?

Just download it from the WordPress plugins repository, activate it and enjoy!

Plugin info

Current version: 1.26
Author: Jordi Plana
Release log:

1.26

  • Strip shortcodes function added in order to sanitize description.

1.25

  • Added extra process to get first image attachment as sharing thumbnail, in case of post-thumbnail ausence.

1.21

  • Fixed a bug about thumbnail sharing.

1.1

  • Added extra sanitization of description
  • Added more Open Graph tags: type, url, locale and sitename.

TODO:

  • Develop an user interface to manually introduce which content will be shown.
  • Integration with WordPress SEO by Yoast plugin.
  • Integration with WPML.

21 Responses to “WordPress Plugin: Open Graph Metatags for Facebook”

  1. Steve Axworthy

    Hello, I have been struggling with some posts on my clients site pulling a generic image and description on the fb share….only some posts.. if you go here: http://jlcauvin.com/?page_id=2 and share the first post “How To Get Along With A Struggling Comedian” you will see the generic image and Official Website in the share… the same is true for teh second and third posts… but if you share the 4th one “The Righteous Prick 2012 Oscar Breakdown” you will see a choice of thumbnails and “The Righteous Prick 2012 Oscar Breakdown” as the description.

    I have installed and activated your plug-in and see no change.. can you please advise or direct me to some solution please?

    Thank you,
    Steve Axworthy

    Reply
    • Jordi Plana

      Jordi Plana

      Hello Steve,
      Thanks for using the plugin!

      I’ve visited your site and I found the correct Open Graph Metatags showing up for all the four posts. For example in the case of “The Righteous Prick 2012 Oscar Breakdown” the Open Graph Metatag for og:description shows this text: “The 2012 Oscar Nominations were announced for what I believe was the worst year in movies since 2005 (Crash beat Brokeback Mountain while Munich, my favorite movie …”. I’ve checked to share in Facebook and this text came up.

      The Open Graph og:image should point to the post thumbnail. I have been also checking the plugin code and I repaired some bugs about the thumbnail sharing. You should update the plugin to the last version, and check it again. This should fix the image problem.

      Best regards.

      Reply
    • Jordi Plana

      Jordi Plana

      Hello Mubarak,
      Thanks for using the plugin!

      Which version of the plugin are you using? You should use the last version.

      The plugin checks for the post thumbnail as og:image. Your theme has to support ‘post-thumbnail’ feature, and your post must have an image set as thumbnail.

      Check out this tips and tell me if you solved the problem.

      Best regards.

      Reply
  2. andrew

    Hi Jordi,

    I am using your plug in, thanks for making it. I am not sure if your plug would fix this problem, but when a post is liked on my site, the wrong thumbnail appears. Even if I post the link, I am unable to select a thumbnail for the video in the post, only the site’s logo. Like I said, don’t know if your plugin is supposed to fix this.

    Thanks for your help

    Andrew.

    Reply
    • Jordi Plana

      Jordi Plana

      Hello Andrew,

      Thanks for using my plugin.

      The plugin checks for the featured thumbnail of the post, and makes it the ‘sharing thumbnail’. If the thumbnail is not defined, it just does not print the og:image Open Graph tag (this means Facebooks uses the first image it finds when rendering the site).

      In your case you should define one image as featured thumbnail of your video post and that’s it!

      Regards

      Reply
  3. Gio

    Hi,

    I also have the same problem like the others. I already installed the plugin and activated it but still the problem exist. Can you check it too? Sharing the link on facebook and it doesnt show the right post title and the right post description. Thanks in advance.

    Reply
    • Jordi Plana

      Jordi Plana

      Hello Dio,
      Thanks for using my plugin.

      The plugin checks for the post featured image as the sharing thumbnail. If there isn’t any thumbnail defined it doesn’t show the og:image metatag, and in consequence Facebook will scrap any other image.

      Please try defining the post thumbnail and tell me if this solves your problem.

      Best regards

      Reply
  4. Gio

    Hi,

    I am so sorry. I am noob about this..Can you help me check on it. myourstyle dot com. Please bro.
    Thanks!

    Reply
  5. Gio

    I do have the featured thumb but when I will share the url of the blogs post to fb.. It will only show the thumbnail, but with the homepage title and homepage meta description.

    Reply
    • Jordi Plana

      Jordi Plana

      Hello Gio,

      I checked your site and the og:image tag is not appearing.

      Please update the plugin to the last version (1.25). In this version I made a patch to take the first image attached to the post in case the plugin doesn’t find the post thumbnail.

      Try updating and tell me the results.

      Regards

      Reply
  6. Paco Pulido

    Hola Jordi, lo primero muchas gracias por el Plugin, me está ayudando mucho con esto!

    He instalado la versión 1.26 y activado el plugin. Cuando comparto un enlace sigue sin mostrarme la meta información, ni la imagen ni ninguna descripción. Si compruebo el código veo que realmente el plugin está funcionando ya que todos los campos meta tag que incluye tienen su correspondiente content. Por ejemplo la imagen en miniatura si lo ves la está recogiendo bien, pero debo hacer algo mal porque no se muestra… No debe ser competencia tuya pues como te digo, el plugin hace su función, pero ¿Podrías orientarme? Muchas gracias, un saludo!

    Reply
    • Jordi Plana

      Jordi Plana

      Hola Paco,
      Gracias por usar el plugin. Te aconsejo que instales la última versión del plugin WordPress SEO de Yoast. Además de ser un plugin genial para la indexación en buscadores, trae una funcionalidad muy parecida a la de mi plugin de manera automática.

      Prueba y me comentas.
      Un saludo

      Reply

Leave a Reply