
When a link is shared on Facebook it will be crawled to get the page title and description. The way Facebook will get this information is to search for Open Graph tags, these are meta tags added to your page with a title, description and image data. This data is then used to populate the Facebook status box when someone shares your link.
Add the following to your head tag so that Facebook will understand the content you are posting.
Page Title
To tell Facebook what the title of the page is you need to use the meta tag og:title, this will appear at the top of the post on Facebook.
<meta property="og:title" content="" />
Page Type
As you can post lots of different type of content to Facebook includes, articles, activities, businesses, groups, people, places..etc you can use the type meta tag to tell Facebook what type of content this is.
<meta property="og:type" content="" />
Post Image
You can set an image to use as the post image on Facebook by using the image meta tag.
<meta property="og:image" content="" />
Post URL
To set the URL for the shared link. This will be the link that will be placed on Facebook when your content is shared.
<meta property="og:url" content="" />
Post Description
Along with a default title and image you can set a small description of the content.
<meta property="og:description" content="" />
Site Name
Provide Facebook with your website name which can be referenced in your post on Facebook.
<meta property="og:site_name" content="<?php echo get_bloginfo('name'); ?/>" />
WordPress doesn't come with the functionality to add Facebook open graph meta tags, but you can use the below snippet to add open graph meta tags to all your posts.
Continue reading
