{"id":9712,"date":"2011-05-10T22:37:33","date_gmt":"2011-05-10T14:37:33","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=9712"},"modified":"2025-04-04T01:04:39","modified_gmt":"2025-04-03T17:04:39","slug":"facebook-open-graph-wordpress","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/","title":{"rendered":"How to Integrate Facebook Open Graph With WordPress"},"content":{"rendered":"<p>Facebook <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/sharing\/opengraph\">Open Graph protocol<\/a> allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is \u2013 whenever someone <em>liked<\/em> your content(s), it will be published on their Facebook profile. But that\u2019s not all, Open Graph allows you to explore more interesting ways to interact and engage with your readers. Ultimately \u2013 if this is done right \u2013 it builds up your brand and increases your site\u2019s traffic.<\/p>\n<p>In today\u2019s post, we are going to look into <strong>how to integrate Facebook Open Graph with a self-hosted WordPress<\/strong> in a detailed step-by-step guide. It will require editing your existing <a rel=\"nofollow noopener noreferrer\" href=\"https:\/\/www.hongkiat.com\/blog\/go\/elegant\">WordPress Themes<\/a> and creating a Facebook application (if you don\u2019t have one).<\/p>\n<p>Ready? Let\u2019s fire up the browser and your <a href=\"https:\/\/www.hongkiat.com\/blog\/free-code-editors-reviewed\/\">favourite code editor<\/a>. Full guide after jump.<\/p>\n<h2>Step 1. Create a facebook App<\/h2>\n<p>We\u2019ll need an <strong>Application ID<\/strong> and to get that, you\u2019ll need to create a Facebook App. If you already have a one, move on to step 2.<\/p>\n<p>Creating an application is easy, here\u2019s what you do:<\/p>\n<ol>\n<li>Logon to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.facebook.com\/\">Facebook<\/a>, go to the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.facebook.com\/developers\/\">Developer\u2019s page<\/a>.<\/li>\n<li>Click \u201c<a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.facebook.com\/developers\/createapp.php\"><strong>Set up a new app<\/strong><\/a>\u201d button on the top right corner.<\/li>\n<li><strong>Give a name<\/strong> to your new app, <strong>agree<\/strong> to Facebook terms, hit <strong>Create app<\/strong>. <\/li>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg\" width=\"500\" height=\"161\" alt=\"create fb app\"><\/figure>\n<li>Go to <strong>Web Site<\/strong> tab, fill up <em>Site URL<\/em> and <em>Site Domain<\/em>.<\/li>\n<li>Note down the value of <strong>Application ID<\/strong> somewhere and hit the \u201c<strong>Save Changes<\/strong>\u201d button. <\/li>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-05.jpg\" width=\"500\" height=\"143\" alt=\"get fb app id\"><\/figure>\n<\/ol>\n<p>That\u2019s all! You can always come back later to fill up the rest of the information.<\/p>\n<h2>Step 2. Replace &lt;HTML&gt; Tag<\/h2>\n<p>Open up your theme\u2019s header file <em>(header.php)<\/em> in your favorite editor. Always keep a backup copy just in case anything goes wrong.<\/p>\n<p>Look for this following line of code, or one that starts with &lt;html xmlns=\u201dhttps:\/\/www.w3.org\/\u2026<\/p>\n<pre>&lt;html xmlns=\"https:\/\/www.w3.org\/1999\/xhtml\" &lt;?php language_attributes(); ?&gt;&gt;<\/pre>\n<p>Replace it with:<\/p>\n<pre>&lt;html xmlns=\"https:\/\/www.w3.org\/1999\/xhtml\" xmlns:og=\"https:\/\/ogp.me\/ns#\" xmlns:fb=\"https:\/\/www.facebook.com\/2008\/fbml\"&gt;<\/pre>\n<p>Keep header.php open, we are going to need it for the 3rd step.<\/p>\n<h2>Step 3. Insert OG &lt;Meta&gt; tags<\/h2>\n<p>Paste the following code right after <code>&lt;head&gt;<\/code> tag, or before <code>&lt;\/head&gt;<\/code> tag.<\/p>\n<pre>&lt;?php if (have_posts()):while(have_posts()):the_post(); endwhile; endif;?&gt;\r\n &lt;!-- the default values --&gt;\r\n &lt;meta property=\"fb:app_id\" content=\"your_fb_app_id\" \/&gt;\r\n &lt;meta property=\"fb:admins\" content=\"your_fb_admin_id\" \/&gt;\r\n \r\n &lt;!-- if page is content page --&gt;\r\n &lt;?php if (is_single()) { ?&gt;\r\n &lt;meta property=\"og:url\" content=\"&lt;?php the_permalink() ?&gt;\"\/&gt;\r\n &lt;meta property=\"og:title\" content=\"&lt;?php single_post_title(''); ?&gt;\" \/&gt;\r\n &lt;meta property=\"og:description\" content=\"&lt;?php echo strip_tags(get_the_excerpt($post-&gt;ID)); ?&gt;\" \/&gt;\r\n &lt;meta property=\"og:type\" content=\"article\" \/&gt;\r\n &lt;meta property=\"og:image\" content=\"&lt;?php if (function_exists('wp_get_attachment_thumb_url')) {echo wp_get_attachment_thumb_url(get_post_thumbnail_id($post-&gt;ID)); }?&gt;\" \/&gt;\r\n \r\n &lt;!-- if page is others --&gt;\r\n &lt;?php } else { ?&gt;\r\n &lt;meta property=\"og:site_name\" content=\"&lt;?php bloginfo('name'); ?&gt;\" \/&gt;\r\n &lt;meta property=\"og:description\" content=\"&lt;?php bloginfo('description'); ?&gt;\" \/&gt;\r\n &lt;meta property=\"og:type\" content=\"website\" \/&gt;\r\n &lt;meta property=\"og:image\" content=\"logo.jpg\" \/&gt; &lt;?php } ?&gt;<\/pre>\n<p>Here are some of the the values you\u2019ll need to alter:<\/p>\n<ul>\n<li>Line 3: Replace <em>your_fb_app_id<\/em> with the <strong>Application ID<\/strong> from Step 1.<\/li>\n<li>Line 4: You can get <em>your_fb_admin_id<\/em> under your <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.facebook.com\/insights\/\">Facebook Insights page<\/a>, (<a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.facebook.com\/help\/?search=insights\">More info<\/a>). Click on the \u201c<strong>Insight for your website<\/strong>\u201d green button, grab the entire string of code and replace Line 4.<\/li>\n<li>Line 12: This line determines the image that represents your post. If your theme supports <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Function_Reference\/wp_get_attachment_thumb_url\">WordPress Post Thumbnails<\/a>, it should work fine. But if it doesn\u2019t, it will fail gracefully without an image. Check out Step 3a for an alternative workaround.<\/li>\n<li>Line 19: Replace <em>logo.jpg<\/em> with an url to your blog\u2019s logo. It will be displayed when a non-post page on your blog is shared on Facebook.<\/li>\n<\/ul>\n<h3>Step 3a \u2013 When \u201cwp_get_attachment_thumb_url\u201d Fail<\/h3>\n<p>When <code>wp_get_attachment_thumb_url()<\/code> failed to work, you are likely going to a content attribute with no value, like what\u2019s shown below:<\/p>\n<pre>&lt;meta property=\"og:image\" content=\"\" \/&gt;<\/pre>\n<p>A simple workaround will be to replace Line 12 with the following code:<\/p>\n<pre>&lt;meta property=\"og:image\" content=\"&lt;?php if (function_exists('catch_that_image')) {echo catch_that_image(); }?&gt;\" \/&gt;<\/pre>\n<p>Next, open up <em>functions.php<\/em> and insert the following code:<\/p>\n<pre>function catch_that_image() {\r\n global $post, $posts;\r\n $first_img = '';\r\n ob_start();\r\n ob_end_clean();\r\n $output = preg_match_all('\/&lt;img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*&gt;\/i', $post-&gt;post_content, $matches);\r\n $first_img = $matches [1] [0];\r\n if(empty($first_img)){\r\n \/\/Defines a default image\r\n $first_img = \"\/images\/default.jpg\";\r\n }\r\n return $first_img;\r\n }<\/pre>\n<p>This replacement code attempts to use a function call <span class=\"php\"><code>catch_that_image()<\/code><\/span> to grab and output the URL of the first image it comes to encounter. Replace line 10 with URL to a default image if the function fails to find its first image.<\/p>\n<h2>Step 4. Insert Facebook Javascript SDK<\/h2>\n<p>The following Javascript gives you to access all of the features of the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/graph-api\">Graph API and Dialogs<\/a>. It also allows you to integrate <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/plugins\/\">Facebook social plugins<\/a> like the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/plugins\/like-button\">Like button<\/a>, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/plugins\/facepile\">Facepile<\/a>, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/plugins\/recommendations\">Recommendations<\/a>, etc with ease.<\/p>\n<p>Place it in <em>header.php<\/em>, right after <code>&lt;body&gt;<\/code><\/p>\n<pre>&lt;div id=\"fb-root\"&gt;&lt;\/div&gt;\r\n &lt;script&gt;\r\n window.fbAsyncInit = function() {\r\n FB.init({appId: 'your_fb_app_id', status: true, cookie: true,\r\n xfbml: true});\r\n };\r\n (function() {\r\n var e = document.createElement('script'); e.async = true;\r\n e.src = document.location.protocol +\r\n '\/\/connect.facebook.net\/en_US\/all.js';\r\n document.getElementById('fb-root').appendChild(e);\r\n }());\r\n &lt;\/script&gt;<\/pre>\n<p>Replace <em>your_fb_app_id<\/em> in Line 4 with <strong>Application ID<\/strong> from Step 1 earlier.<\/p>\n<h2>Step 5. Let\u2019s test it!<\/h2>\n<p>We are done integrating Facebook Open Graph to the WordPress blog. Let\u2019s give it a couple of test to make sure we\u2019ve done things correctly.<\/p>\n<h3>Test #1 \u2013 View source code<\/h3>\n<p>Take a look at the source codes of one of the blog post, you should have something like this:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/meta-values.jpg\" width=\"500\" height=\"101\" alt=\"meta values\"><\/figure>\n<p>Check the properties and its values, make sure they are correct.<\/p>\n<h3>Test #2 \u2013 Install a Like Box<\/h3>\n<p>If you haven\u2019t install a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.facebook.com\/docs\/plugins\/like-button\/\">Facebook Like Button<\/a>, then it\u2019s probably time to get one. Place the following code anywhere (preferably before content or after content) inside <em>single.php<\/em>:<\/p>\n<pre>&lt;fb:like href=\"&lt;?php the_permalink() ?&gt;\" layout=\"button_count\" show_faces=\"false\" width=\"450\" action=\"like\" colorscheme=\"light\"&gt;&lt;\/fb:like&gt;<\/pre>\n<p>Next, get a friend to <em>Like<\/em> it. You should see something similar appearing in his Facebook profile:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/facebook-like-in-profile.jpg\" width=\"500\" height=\"156\" alt=\"facebook profile\"><\/figure>\n<h2>Extra: WordPress Plugin<\/h2>\n<p>If somehow you failed to install the codes or need this to be done quick and easy \u2013 there\u2019s a WordPress plugin for that.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/wordpress.org\/\/extend\/plugins\/facebook-open-graph-meta-in-wordpress\/\">Facebook Open Graph Meta in WordPress<\/a> is a WordPress plugin that adds Facebook meta data to avoid no thumbnail issue, wrong title issue, wrong description issue, etc.<\/p>","protected":false},"excerpt":{"rendered":"<p>Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is \u2013 whenever someone liked your content(s), it will be published on their Facebook profile. But that\u2019s not all, Open Graph allows you to explore more interesting ways to interact&hellip;<\/p>\n","protected":false},"author":73,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[4663,158,252],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Integrate Facebook Open Graph With Wordpress - Hongkiat<\/title>\n<meta name=\"description\" content=\"Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is -\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Integrate Facebook Open Graph With Wordpress\" \/>\n<meta property=\"og:description\" content=\"Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is -\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2011-05-10T14:37:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:04:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg\" \/>\n<meta name=\"author\" content=\"Donna AG\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Donna AG\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/\"},\"author\":{\"name\":\"Donna AG\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e6841e56cb44e0a2c65d38b62f535be6\"},\"headline\":\"How to Integrate Facebook Open Graph With WordPress\",\"datePublished\":\"2011-05-10T14:37:33+00:00\",\"dateModified\":\"2025-04-03T17:04:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/\"},\"wordCount\":785,\"commentCount\":40,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/facebook-open-graph-wordpress\\\/create-fb-app-step-03.jpg\",\"keywords\":[\"ad-divi\",\"Facebook\",\"WordPress Tips\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/\",\"name\":\"How to Integrate Facebook Open Graph With Wordpress - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/facebook-open-graph-wordpress\\\/create-fb-app-step-03.jpg\",\"datePublished\":\"2011-05-10T14:37:33+00:00\",\"dateModified\":\"2025-04-03T17:04:39+00:00\",\"description\":\"Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is -\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/facebook-open-graph-wordpress\\\/create-fb-app-step-03.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/facebook-open-graph-wordpress\\\/create-fb-app-step-03.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/facebook-open-graph-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Integrate Facebook Open Graph With WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e6841e56cb44e0a2c65d38b62f535be6\",\"name\":\"Donna AG\",\"description\":\"Donna is a web designer\\\/developer, a Facebook addict and a fan of Apple. She can be contacted via email.\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/donnaag\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Integrate Facebook Open Graph With Wordpress - Hongkiat","description":"Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Integrate Facebook Open Graph With Wordpress","og_description":"Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is -","og_url":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2011-05-10T14:37:33+00:00","article_modified_time":"2025-04-03T17:04:39+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg","type":"","width":"","height":""}],"author":"Donna AG","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Donna AG","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/"},"author":{"name":"Donna AG","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e6841e56cb44e0a2c65d38b62f535be6"},"headline":"How to Integrate Facebook Open Graph With WordPress","datePublished":"2011-05-10T14:37:33+00:00","dateModified":"2025-04-03T17:04:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/"},"wordCount":785,"commentCount":40,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg","keywords":["ad-divi","Facebook","WordPress Tips"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/","url":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/","name":"How to Integrate Facebook Open Graph With Wordpress - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg","datePublished":"2011-05-10T14:37:33+00:00","dateModified":"2025-04-03T17:04:39+00:00","description":"Facebook Open Graph protocol allows you to share your blog content not only with your readers, but their Facebook friends as well. The best part is -","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/facebook-open-graph-wordpress\/create-fb-app-step-03.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/facebook-open-graph-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Integrate Facebook Open Graph With WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e6841e56cb44e0a2c65d38b62f535be6","name":"Donna AG","description":"Donna is a web designer\/developer, a Facebook addict and a fan of Apple. She can be contacted via email.","url":"https:\/\/www.hongkiat.com\/blog\/author\/donnaag\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-2wE","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/9712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=9712"}],"version-history":[{"count":5,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/9712\/revisions"}],"predecessor-version":[{"id":73502,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/9712\/revisions\/73502"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=9712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=9712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=9712"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=9712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}