{"id":552,"date":"2014-01-01T23:04:58","date_gmt":"2014-01-01T17:04:58","guid":{"rendered":"http:\/\/w4dev.com\/?p=552"},"modified":"2015-02-03T23:16:26","modified_gmt":"2015-02-03T17:16:26","slug":"facebook-page-like-count-wordpress-shortcode","status":"publish","type":"post","link":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/","title":{"rendered":"Facebook Page Like Count WordPress Shortcode"},"content":{"rendered":"<p>The easiest way to show your facebook page like count is to use the facebook like button. As it comes with a limited module and not show only the number count rather than adding a like or recommend text, somewhere it becomes useless. However they have API to server you the count in number, if you have proper code.<\/p>\n<pre class=\"prettyprint\">\r\nadd_shortcode('fb_likes', 'w4dev_fb_like_count_shortcode' );\r\nfunction w4dev_fb_like_count_shortcode( $atts )\r\n{\r\n\textract( shortcode_atts( array(\r\n\t\t'page' => 'w4dev'\r\n\t), $atts ));\r\n\t$count = facebook_like_count( $page );\r\n\treturn $count;\r\n}\r\nfunction w4dev_fb_like_count( $page = 'w4dev' ){\r\n\t$url = 'http:\/\/graph.facebook.com\/'. urlencode( $page );\r\n\t$content = wp_remote_retrieve_body( wp_remote_request( $url));\r\n\tif( is_wp_error( $content))\r\n\t\treturn 0;\r\n\r\n\t$content = json_decode( $content);\r\n\t$value = intval( $content-&gt;likes);\r\n\r\n\treturn $value;\r\n}\r\n<\/pre>\n<p>You can use shortcode <code>[fb_likes page=\"mypage\"]<\/code>, or can use function <code>w4dev_fb_like_count(\"mypage\")<\/code> to get your Facebook page likes. <code>mypage<\/code> could be either you facebook page name or page id.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The easiest way to show your facebook page like count is to use the facebook like button. As it comes with a limited module and not show only the number count rather than adding a like or recommend text, somewhere it becomes useless. However they have API to server you the count in number, if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"qubely_global_settings":"","qubely_interactions":"","_eb_attr":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-552","post","type-post","status-publish","format-standard","hentry","category-wp"],"qubely_featured_image_url":null,"qubely_author":{"display_name":"Shazzad Hossain Khan","author_link":"https:\/\/w4dev.com\/author\/shazzad\/"},"qubely_comment":0,"qubely_category":"<a href=\"https:\/\/w4dev.com\/category\/wp\/\" rel=\"category tag\">WordPress<\/a>","qubely_excerpt":"The easiest way to show your facebook page like count is to use the facebook like button. As it comes with a limited module and not show only the number count rather than adding a like or recommend text, somewhere it becomes useless. However they have API to server you the count in number, if&hellip;","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Facebook Page Like Count WordPress Shortcode - W4dev<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Facebook Page Like Count WordPress Shortcode - W4dev\" \/>\n<meta property=\"og:description\" content=\"The easiest way to show your facebook page like count is to use the facebook like button. As it comes with a limited module and not show only the number count rather than adding a like or recommend text, somewhere it becomes useless. However they have API to server you the count in number, if [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/\" \/>\n<meta property=\"og:site_name\" content=\"W4dev\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/w4dev\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/shazzad.wp\" \/>\n<meta property=\"article:published_time\" content=\"2014-01-01T17:04:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-02-03T17:16:26+00:00\" \/>\n<meta name=\"author\" content=\"Shazzad Hossain Khan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/shazzadwp\" \/>\n<meta name=\"twitter:site\" content=\"@w4dev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shazzad Hossain Khan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/\"},\"author\":{\"name\":\"Shazzad Hossain Khan\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/#\\\/schema\\\/person\\\/6cffe5a17e4e7c920071c2d8e275bec7\"},\"headline\":\"Facebook Page Like Count WordPress Shortcode\",\"datePublished\":\"2014-01-01T17:04:58+00:00\",\"dateModified\":\"2015-02-03T17:16:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/\"},\"wordCount\":89,\"publisher\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/#organization\"},\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/\",\"url\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/\",\"name\":\"Facebook Page Like Count WordPress Shortcode - W4dev\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/#website\"},\"datePublished\":\"2014-01-01T17:04:58+00:00\",\"dateModified\":\"2015-02-03T17:16:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/wp\\\/facebook-page-like-count-wordpress-shortcode\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/w4dev.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Facebook Page Like Count WordPress Shortcode\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/#website\",\"url\":\"https:\\\/\\\/w4dev.com\\\/\",\"name\":\"W4dev\",\"description\":\"Best WordPress Plugins\",\"publisher\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/w4dev.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/#organization\",\"name\":\"W4dev\",\"url\":\"https:\\\/\\\/w4dev.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/w4dev.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/w4dev-logo-2025.png\",\"contentUrl\":\"https:\\\/\\\/w4dev.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/w4dev-logo-2025.png\",\"width\":1022,\"height\":328,\"caption\":\"W4dev\"},\"image\":{\"@id\":\"https:\\\/\\\/w4dev.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/w4dev\",\"https:\\\/\\\/x.com\\\/w4dev\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/w4dev.com\\\/#\\\/schema\\\/person\\\/6cffe5a17e4e7c920071c2d8e275bec7\",\"name\":\"Shazzad Hossain Khan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?s=96&d=mm&r=g\",\"caption\":\"Shazzad Hossain Khan\"},\"sameAs\":[\"https:\\\/\\\/shazzad.me\",\"http:\\\/\\\/www.facebook.com\\\/shazzad.wp\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/shazzadwp\"],\"url\":\"https:\\\/\\\/w4dev.com\\\/author\\\/shazzad\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Facebook Page Like Count WordPress Shortcode - W4dev","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:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/","og_locale":"en_US","og_type":"article","og_title":"Facebook Page Like Count WordPress Shortcode - W4dev","og_description":"The easiest way to show your facebook page like count is to use the facebook like button. As it comes with a limited module and not show only the number count rather than adding a like or recommend text, somewhere it becomes useless. However they have API to server you the count in number, if [&hellip;]","og_url":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/","og_site_name":"W4dev","article_publisher":"https:\/\/www.facebook.com\/w4dev","article_author":"http:\/\/www.facebook.com\/shazzad.wp","article_published_time":"2014-01-01T17:04:58+00:00","article_modified_time":"2015-02-03T17:16:26+00:00","author":"Shazzad Hossain Khan","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/shazzadwp","twitter_site":"@w4dev","twitter_misc":{"Written by":"Shazzad Hossain Khan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/#article","isPartOf":{"@id":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/"},"author":{"name":"Shazzad Hossain Khan","@id":"https:\/\/w4dev.com\/#\/schema\/person\/6cffe5a17e4e7c920071c2d8e275bec7"},"headline":"Facebook Page Like Count WordPress Shortcode","datePublished":"2014-01-01T17:04:58+00:00","dateModified":"2015-02-03T17:16:26+00:00","mainEntityOfPage":{"@id":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/"},"wordCount":89,"publisher":{"@id":"https:\/\/w4dev.com\/#organization"},"articleSection":["WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/","url":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/","name":"Facebook Page Like Count WordPress Shortcode - W4dev","isPartOf":{"@id":"https:\/\/w4dev.com\/#website"},"datePublished":"2014-01-01T17:04:58+00:00","dateModified":"2015-02-03T17:16:26+00:00","breadcrumb":{"@id":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/w4dev.com\/wp\/facebook-page-like-count-wordpress-shortcode\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/w4dev.com\/"},{"@type":"ListItem","position":2,"name":"Facebook Page Like Count WordPress Shortcode"}]},{"@type":"WebSite","@id":"https:\/\/w4dev.com\/#website","url":"https:\/\/w4dev.com\/","name":"W4dev","description":"Best WordPress Plugins","publisher":{"@id":"https:\/\/w4dev.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/w4dev.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/w4dev.com\/#organization","name":"W4dev","url":"https:\/\/w4dev.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/w4dev.com\/#\/schema\/logo\/image\/","url":"https:\/\/w4dev.com\/wp-content\/uploads\/2026\/02\/w4dev-logo-2025.png","contentUrl":"https:\/\/w4dev.com\/wp-content\/uploads\/2026\/02\/w4dev-logo-2025.png","width":1022,"height":328,"caption":"W4dev"},"image":{"@id":"https:\/\/w4dev.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/w4dev","https:\/\/x.com\/w4dev"]},{"@type":"Person","@id":"https:\/\/w4dev.com\/#\/schema\/person\/6cffe5a17e4e7c920071c2d8e275bec7","name":"Shazzad Hossain Khan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6b16b41301e0e27abe50b08f308894664ce3a79e5906c9c8e80b5e2558854218?s=96&d=mm&r=g","caption":"Shazzad Hossain Khan"},"sameAs":["https:\/\/shazzad.me","http:\/\/www.facebook.com\/shazzad.wp","https:\/\/x.com\/https:\/\/twitter.com\/shazzadwp"],"url":"https:\/\/w4dev.com\/author\/shazzad\/"}]}},"_links":{"self":[{"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/posts\/552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/comments?post=552"}],"version-history":[{"count":0,"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/posts\/552\/revisions"}],"wp:attachment":[{"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/media?parent=552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/categories?post=552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w4dev.com\/wp-json\/wp\/v2\/tags?post=552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}