Share counts
Facebook share count: getting it from the Graph API
Quick answer
Facebook share counts come from the Graph API: request the URL object with the engagement field and an access token, and you receive share, reaction and comment figures. The old REST endpoint and token-free requests stopped working years ago, which is why many plugins show zero. Use an app access token, cache results, and refresh older posts less often.
On this page
Why old plugins show zero
Early share plugins read Facebook counts from the legacy REST API or from Graph requests without a token. Facebook deprecated the REST API for apps on Graph API v2.1 and later, and then began requiring tokens and enforcing rate limits. The old post on this domain announcing that the REST API was deprecated for versions 2.1 and higher collected links because thousands of sites hit this at once. Counters that were never updated still return nothing.
The request today
Ask the Graph API for the URL as an object and request its engagement field. The response contains separate figures for shares, reactions, comments and plugin comments. The exact API version in the path changes over time, so use the current version listed in Facebook's developer documentation.
GET https://graph.facebook.com/{version}/?id={encoded URL}&fields=engagement&access_token={app access token}
{
"engagement": {
"reaction_count": 12,
"comment_count": 3,
"share_count": 40,
"comment_plugin_count": 0
},
"id": "https://example.com/post/"
}You need an access token. An app access token, made from your app ID and app secret, is the usual choice for a server-side counter. See creating a Facebook app ID and choosing and creating a Facebook access token.
Rate limits and caching
The Graph API limits how many calls an app can make in a period. A plugin that asks on every page view will hit that limit on a busy site and then receive errors, which many plugins display as zero. Store the count per post with a timestamp and refresh on a schedule that slows as the post ages.
Keep the secret secret
- An app access token contains your app secret. Keep it on the server, never in page source or JavaScript.
- If the secret is ever exposed, reset it in the app dashboard; that invalidates the old token.
- Store it in
wp-config.phpor the plugin's settings, not in a theme file under version control.
Questions
Why is my Facebook share count zero?
Usually the plugin uses an old endpoint, has no valid token, or has been rate limited. Check the token and the plugin's last update date.
Do I need an access token for Facebook share counts?
Yes. Current Graph API requests for URL engagement need a token; an app access token works for server-side counters.
Does the share count include reactions?
The API returns reactions separately. Whether they are added into one number depends on your plugin.
Hannah Voss, Editor. Checks every guide against a working WordPress install and the networks' current documentation. Last reviewed September 2026.
Related guides
- How to create a Facebook access tokenCreate the right Facebook access token for share counts and plugins: user, page and app tokens compared, how long each lasts, and how to keep the token safe.3 min read
- Share count not updating or not accurate: a fix listShare counts stuck, stuck at zero or wrong? Work through tokens, caches, cron, URL variants and rate limits in order, and why you should never add fake shares.3 min read
- How share counts work, and why most networks stoppedHow Facebook and other networks calculate share counts, why X, LinkedIn and others removed them, what a share counter really shows, and how plugins fetch it.3 min read