This script will get number of shares of a post url from usual social networks and return the information as JSON.

Social networks


  • Facebook’s likes and shares
  • Twitter
  • LinkedIn’s shares
  • Google plus’ shares


(You are free to put it anywhere you want if you know how to access it by url, of course.)

  • Drop the file getShares.php in your wordpress main directory, next to wp-config.php file.
  • Call the file by url, per example:


By default, the script return the last seven days posts, sorted by date of publication (by wordpress) and displayed in a table.
You can override this with parameters:


The script will return posts from the last day, sorted by shares count and in JSON format.

The link


  • Add a parameter to get result for only one specific url.