WordPress OpenGraph Plugin

WordPress OpenGraph, a simple and lightweight plugin to automatically add OpenGraph meta tag to the head section of your WordPress Blog. The OpenGraph meta tags helps your visitors to share your content in social media websites with proper title, description and image.

WordPress OpenGraph Plugin Features

Here are some of the basic features of the WordPress OpenGraph Plugin that you might find useful.

  1. Uses Post Title as the OpenGraph Title. Doesn’t matter whether you are using Thesis, Genesis or any other SEO Plugins.
  2. Uses first 25 words in post content. You can, however, change it from the settings page.
  3. If you are using Thesis or Genesis Post Image, the plugin will use that as the OpenGraph image. If not, the plugin will look for a featured image and use that if present. If that is also not there, the plugin will look for images uploaded for that post. If that too isn’t there, the plugin will use a default thumbnail which you can set from the settings page.
  4. If you are using JetPack, the plugin will disable the OpenGraph tags generated by it. Therefore, no conflict.
  5. Supports 77 Blog Languages.

WordPress OpenGraph Plugin Configuration

You can customize almost everything this plugin outputs. All you need to go to Settings > OpenGraph and customize it.

  • Facebook App ID: If you have a Facebook App for your blog, you can enter the Application ID to farther customize the sharing.
  • Facebook Admin ID: It’s normally your own ID (not username, but the ID). If you don’t know what it is, check here. Just replace “abhiktheone” with your username.
  • Default Thumbnail URL: The URL to your default thumbnail URL. It will be used if no image is found for your post. I am working on an onpage uploader, but meanwhile you can upload the thumbnail using the WordPress Media Uploader and copy/paste the URL.
  • Blog Language: The language of your blog.
  • Description Word Limit: The number of the words you want in your OpenGraph description. The default of 25 words works just fine.

WordPress OpenGraph Plugin Installation

The installation of WordPress OpenGraph Plugin is super easy.. Just follow the standard procedure.

  • Upload ‘opengraph-microdata-generator‘ folder and all it’s contents to the ‘/wp-content/plugins/‘ directory.
  • Activate the plugin ‘Opengraph and Microdata Generator‘ through the ‘Plugins’ menu in WordPress
  • Start customizing the settings from Settings > OpenGraph.


wordpress opengraph plugin



Get Updates In Your Inbox

Get the WordPress Tips and latst Internet Marketing ideas delivered directly to your email inbox, plus access to our FREE Pro Blogging Model blogging guide.

You need to confirm your email once. Don't worry, we hate SPAMs as much as you do


  1. says

    Hello, I’ve activated the plugin and input my fb id number and thumbnail image url however when I go to share my site on FB it still pulls a random image from a banner on my page. Please advise? Thanks,

    • says

      In that case, the Facebook crawler is picking up all the images present in that page.
      There should be a thumbnail selector arrows in Facebook while sharing the link. You can use that to select the proper thumbnail.

      Do you have any other plugin installed that deals with opengraph or any other schema markups?

  2. says

    Thank you for the great tutorial. I have an additional question: is it possible to use existing facebook fanpage as a app while implementing the open graph into my wordpress instalation? my your_fb_app_id would be an ID of my facebook page?

  3. Kim Viljanen says


    There seem to be a bug with creating a correct og:image URL if the image is located on an external webserver.

    Check this example:

    The line:

    is incorrect. Should be without the “otsokivekas.fi” in the beginning.

    I think the error might be on the following lines in the plugin:

    176 $pos = strpos($image, site_url());
    177 if ($pos === false) {
    178 return $_SERVER['HTTP_HOST'].$image;
    179 } else {
    180 return $image;
    181 }

    There should be an additional check for the $image variable, to check if it is a URL, that is, if there is a protocol in the beginning continuing with a colon. E.g. “http:”, “https:”, “ftp:”, …

    Could somebody fix this who knows the code better? Thank you very much! Otherwise the plugin rules and thanks for making it available! :)


    • Kim Viljanen says

      Argh, the line disapeared since it was HTML code. Here is the wrong line in the HTMLT output (shown below without the greater than / less than marks in the beginning and the end):

      meta property=”og:image” content=”otsokivekas.fihttp://upload.wikimedia.org/wikipedia/commons/0/0f/Kartta_vanha_suomi.png”

    • says

      Yes, you can use a default image that can be accessed via the domain where the plugin is installed.
      Why don’t you just upload the image in your own server and use that link?

      • Kim Viljanen says

        Thanks for the reply! The problem is that we have a big archive consisting of years of postings that now were imported to the new site but the images are hosted elsewhere. (Not sure if they will be imported later, but at the current moment that is not possible.)

        Also, frankly, I think the plugin just works wrongly if it invalidates a completely correct URL by putting a wrong string in the front of the URL… Or what do you think?

  4. alex says

    I am using Thesis theme and there is no header.php.  Any idea where to add it ? If i add it to the tag do I add it like this: itemscope itemtype=�?http://schema.org/Blog or like this  ?

  5. says


    I installed this plugin and have added the line manually to the header.php file. My problem is that I do not have a facebook admin id / nor am I an open graph user at this point as I have no app in my name. 

    Hence when i run the site through the w3c validator, it gives me a lot of open graph related errors. Is there a way i can locate or activate an opengraph id or should i not worry about it. 

    I am mostly interested in the plugin since it seems to be quite good in dealing with microformats. In the current SEO landscape this is the future. 

    Please guide. Thanks


      • says

        Hey, thanks for the quick reply. Btw, I use a custom excerpt for most blog posts however, the plugin extracts the first n characters from my post. Is there a way to ensure that it uses the custom excerpt from wordpress that I am defining for that post? 

        Also, It would be great if you allowed the same open graph data to be shared with general meta as well. I am a bit of a newbie at this hence I dont know for sure if the same data works with both (search engines and facebook). 

        • says

          the problem is with this line:
          $theContent = trim(strip_tags(get_the_content()));

          it is trimming the content no matter what… i couldn’t find any instance or notion of the excerpt in the plugin code, so i’ve changed it to:

          if(get_the_excerpt()==”[...]“) $theContent = trim(strip_tags(get_the_content()));
          else $theContent = trim(strip_tags(get_the_excerpt()));

          and now it is working as expected. please add this to the next update.

  6. says

    Hi, Quick question. I have shortcodes defined on each post, for mobile and non-mobile, as well as ads inside the post.. Every time I post it to Facebook for e.g. I get the shortcodes on description.


    [wptouch target=non-mobile][/wptouch][wptouch target=webapp][/wptouch][wptouch target=mobile][/wptouch]Hi, Quick question. I have shortcodes defined on each post, for mobile and non-mobile, as well as ads inside the post.. Every time I post it to Facebook for e.g. I get the shortcodes on description. [Google AdSense 468 google468=""]

    There’s a way to exclude [ shortcodes ] ?
    I post all my posts at facebook, google+, digg, etc and I have to remove the shortcodes every time … you know ;)


  7. says

    Abhik, easy fix. Just changed the if(is_single() ) to if(is_single() || is_page() ){ and it worked. May be a good thing to add to the next update. Simple and will make pages work too. I would consider adding is_archive and is_category too.


  8. says

    Facebook debugger had this warning.. “Open Graph Warnings That Should Be Fixed”

    Inferred Property The og:locale property should be explicitly provided, even if a value can be inferred from other tags.

  9. says

    hello, been searching for this plugin but something occur to me on step 3. can you explain how to add “itemscope itemtype=�?http://schema.org/Blog” into header?
    or just copy and paste the line. is it?

  10. says

    Seems to be working fine now – thanks for your help Abhik and good luck with developing the plugin further.

    My only sugggestion for refinement is that it would be good to have a simple settings panel in the admin allowing me to upload my default image, rather than copy it to the specific folder. 

    Thanks again,


  11. says

    You should replace line 44 of your plugin with the following code:

    Several People (like me) have installed wordpress in a subdirectory, only index.php being in the main directory. get_option(‘siteurl’) however points to the wordpress install and not to the url that’s used from outside.

  12. says

    No, I dont (as far as I know!). The strange thing is that even though I cannot see the image when I first created the share (I just see the default facebook blue F logo), one of the test shares that I did earlier is now correctly showing the right image? How can this be?

    • says

      Okay, just updated the plugin to version 1.1. Can you please update the plugin at your blog and try sharing a new blog post?
      Please let me know the result.

      • says

        Have just downloaded the plugin and it is still version 1. (that is what is says in WP). Need to go out now, so will try again first thing tomorrow.

        Thanks for your quick responses so far, and I hope that we can get this fixed.

  13. says

    Have installed your plugin and it is the simplese and easiest to use I have seen so far… BUT…

    the image is not working. You can see the code in the page http://www.powerofgolf.co.uk, and the image that it has listed DOES exist, but when I go to share the page it does not give me a valid image? Everything else works ok – do you have any ideas?

Speak Your Mind

Your email address will not be published. Required fields are marked *

You may use these HTML Tags and Attributes

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>