Make your posts look good on Facebook: Open Graph tags

wordpressfunYour Open Graph tags determine how your website looks when people post a link to it on Facebook.  It also determines how the site looks when you display your blog/news posts on your Facebook page.  I have mixed feelings on whether a Facebook page for your business is really worth it (hint, it totally depends on what type of business you have) but as part of the redesign I set up a new Facebook page for Dabbled Studios, and blog posts here will show up there.  So when they show up, they’d better look good, right?

If you want to be sure how your site pages/posts look to Facebook, you can use the Facebook Debugger.  Just paste the URL to a post, or a page, and click the Debug button, and you can see your site the way facebook sees it.  If you have a WordPress site, it generally won’t look too bad by default, by I wanted to make sure my featured image was the image shown (rather than whatever FB picks!), and generally make sure my posts and pages looked how I wanted them to look.

As part of the site redesign, I pulled all my Open Graph settings into a function.  The code I used is commented below.  You can put this in your functions.php file, or in a plugin, if you’d like to use it.

I used snippets from several sources for this code.