Most Share Posts

Screenshots of the Most Shared Posts plugin on various sites.

The Most Shared Posts plugin for Wordpress allows you to display, as a widget, which of your blog posts have the most social shares and are proving to be your most popular content.

download button Version 1.1.0 - 14th August 2011
hosted on wordpress.org


 

If you'd like to see this plugin in action, you can see it on this site, or you could check out Kate Morris' SEO Blog or John Doherty's SEO Blog. They both helped to test the initial version.

Features

If you have feature requests, bug reports or you just want to show me where you are using the plugin please post a comment below or drop me an email to wpplugins@tomanthony.co.uk.

  • Fetches Facebook Likes, Twitter Tweets and the new Google +1s.
  • Caches results to ensure good performance. Older posts are cached for longer.
  • Select which of the 3 social counts to include.
  • Select how many posts to display in the list, and an age cut-off.
  • For beginners, it is very easy to install with no necessary customisation.
  • For advanced users, there are various display options available.
  • Option to hide the counts and icons.
  • You can have multiple instances on the same page with different titles (e.g "Most Tweeted Posts" showing just the Tweet counts, or "Most Liked Posts" showing just the FB Likes counts etc.)

Installation

The steps to install 'Most Shared Posts' are quite simple:
  1. Upload `most-shared-posts` directory to the `/wp-content/plugins/` directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Go to the 'Widgets' page in the 'Appearance' section of WordPress.
  4. Now you can add the widget to different pages of your site. Recommended pages to add the widget: "Sidebar Index", "Sidebar Single", "Sidebar Category".
  5. You can customise the plugin differently for each of these sections should you wish.
  6. NOTE: The plugin throttles how quickly it gathers the social data, to ensure it does not cause any slowness for your users. For small sites with less than 100 posts, this should typically be done in the first hour. For sites with other 2000 posts it could take a day or more.
  7. Now load a page on your blog which should show the widget. This will initiate the first data fetch.

Frequently Asked Questions

  1. Q: I just installed and refreshed the page, but my most shared posts are not at the top of the list?
    A: The plugin will take a little time to collect all the data about your posts. It does so in batches so as not to upset the social networks by requesting too much data at once. You should find that it'll sort itself out and catch up quite quickly.
  2. Q: I just got tweeted but the count hasn't updated! Why not?
    A: The results for each post are cached for varying lengths of time depending on the posts age. Very recent posts (less than 2 days old) are cached for an hour, and then older posts are cached for incrementally longer periods of time. Posts in the last month are cached for 12 hours, posts 1-6 months old are cached for 48 hours and older posts are cached for a week.
  3. Q: My older posts aren't showing up...
    A: When you add an instance of the widget to a sidebar in the Wordpress admin section, you can customise how far back you wish to look; the default is 2 years.
  4. Q: Where can I change how many posts are included in the list?
    A: When you add an instance of the widget to a sidebar in the Wordpress admin section, you can customise how many posts to include; the default is 5.
  5. Q: I activated the plugin, but I don't see it. :(
    A: This plugin is a widget, so after activating it you need to go to the Appearance->Widgets section of your Wordpress settings and select which pages you'd like it to appear on.
  6. Q: Can I include the count inside a post or a page?
    A: Yes - there is now a shortcode option. The shortcode has a few options (all are optional):

    [most-shared-posts num_posts="5" max_month_age="24" title="Most Shared Posts"]
  7. Q: I have no shares. How depressing... help!
    A: Assuming you're providing content worthy of being shared... Make sure you are including sharing buttons on your blog in a consistent fashion. I recommend adding them into your theme, or alternatively:
    • Alex Moss of Pleer has created some great social button plugins for Twitter, Facebook and Google+.
    • The AddThis plugin is very popular, and provides a variety of sharing buttons.
    • At sharethis.com, they provide a variety of sharing plugins.
    • The Sharedaddy plugin, part of Jetpack from WordPress.com, provides a range of social buttons.

Changelog

Version 1.0.0 - 4th August 2011
  • Initial Release
Version 1.0.1 - 5th August 2011
  • Update on the format of the API requests for added robustness.
  • Added link to the FAQ on plugin activation.
Version 1.1.0 - 14th August 2011
  • Can now view social stats in admin area (with or without an active widget).
  • Added a shortcode option to include within posts/pages.
  • Data now collected without an active widget.
  • Improved method for scheduling data collection.
  • Various code tidying and improvements.

Donate

Please consider a donation, or alternatively enabling the attribution link in the settings:
Donate Button
256 comments on “Most Shared Posts – WordPress Plugin
  1. 5ubliminal

    Consider urlencode()-ing the get_permalink() in the Facebook and Twitter file_get_contents() requests. Stay safe.

    • Tom

      Good shout. I think if someone is already compromising your permalink_structure then you have bigger problems, but you are right. Just rolled that in now. Thanks. :)

  2. Keith Brown

    Cool plugin, similar to what Huffpo and a few others have been doing for awhile to promote content. Also think that showing users that your posts get shared is a good measure of quality. Nothing like landing on a random blog, trying to figure out if it’s legit or not, and seeing all 0′s next to social sharing.

    • Tom

      Thanks, Keith! :)

      Yeah – I agree that social sharing is a key indicator of what people are enjoying, so it not only helps draw attention to the most popular content, but also builds trust AND helps the author see what is being well received and what isn’t.

  3. Patrick Kelly

    Thank you for making this available! I have been wanting this functionality for quite some time. Much appreciated!

    • Tom

      Thanks Patrick!! Looks really nice on your blog! :)

      Let me know if you have any feedback or feature suggestions. Got a few already so going to be doing some updates in the not too distant future.

  4. Ahmed Bakry

    I dunno how to thank you man, if thank you will do i’d be happy..this is exactly what i’ve been looking for ages, if u’d like any Arabic translation support i’d be glad to do it, thanks again Tom, u’re the best

    • Tom

      Hi Ahmed — Thanks a lot. I’m glad you like it! :) If the plugin proves popular I will want to provide some translations so that is a great offer, thanks. :)

  5. hkalant

    Great plugin. Works with the Sharedaddy plugin (part of Jetpack) by WordPress.com, too.

    • Tom

      Thanks – I’ll add that to the FAQ. Glad you like the plugin. :)

  6. Avinash

    Hi.. This is a nice plugin to have, but wanted to know how we can manually call the function, instead of a widget..

    • Tom

      Hi Avinash. Thanks! Yes, a shortcode is on my to do list for the next version, which should be coming in the not too distant future. :)

      • Avinash

        Thanks , I ‘ll be waiting for it.

      • Jean-Paul

        Also eagerly waiting for a short code or template tag version of the plugin. Looks excellent and can’t wait to try it.

      • Tom

        Avinash & Jean-Paul,

        Just updated the plugin now and introduced a shortcode you can use. Let me know how you get on with it!

      • Avinash

        Thanks for the update, I’ve set it up in my blog.

  7. Tim

    I really like your idea(!), but I need an template tag because I do not use a widget sidebar (i dont like it). I also want to write about it. Something like

    • Avinash

      Your can try this to display the most shared posts, without using the widgets.Place the code in the sidebar.php where you want to display the list .

  8. Hun

    For some reason it’s only polling the Google +1 shared entries, and twitter & fb shares are all at 0 – though I know it’s been shared.

    • Tom

      Hi there,

      I’m looking into why this might be – not sure why that might be. Can you send a couple of example URLs?

  9. Mick Lehr

    I’m wondering about the plugin throttle speed. It seems that it would compile social data slowly to not affect page views. But this is all I’ve read about it:
    “The plugin throttles how quickly it gathers the social data, to ensure it does not cause any slowness for your users. For small sites with less than 100 posts, this should typically be done in the first hour. For sites with other 2000 posts it could take a day or more”

    • Tom

      Hi Mick,

      One of the FAQs deals with this:

      “The results for each post are cached for varying lengths of time depending on the posts age. Very recent posts (less than 2 days old) are cached for an hour, and then older posts are cached for incrementally longer periods of time. Posts in the last month are cached for 12 hours, posts 1-6 months old are cached for 48 hours and older posts are cached for a week.”

      Furthermore, it’ll never do more than 15 API calls at once (so with 3 networks it’d be updating 5 posts), and it’ll never do more than one batch every 15 minutes. Should an API call fail, then it’ll wait 6 hours before trying again.

      -Tom

  10. Kevin

    Hey Tom,
    Great plugin, been looking for something like it for awhile and only been able to show users most viewed and most recent posts, now I can add most shared to the list! I’m actually having a few problems though. I’ve tweeted about a recent post a while ago and everything still shows as zero. Also in the dashboard the Images links for the social services are dead. Don’t know if these are related but most importantly its not actually getting the social data! Please help!

    • Tom

      Thanks for your emails about this, Kevin. I think I have fixes for both which should be in the next release. :)

  11. Dan Hatfield

    It doesn’t seem like this plugin accounts for shares pages, just posts. Is that correct? If so, is there an easy way I can adjust to include pages?

    Thanks so much for your help!

    • Tom

      Hi Dan. Yes, currently it is just posts and not pages. However, the next release will have an option to select (for a particular widget), either pages, posts or both. :)

  12. littleoslo

    hey, it is a great plugin, thank you, but one thing i noticed is after i activated it, all the “facebook likes” i have on the old posts are gone, like some of the mosts got 1000 likes, when i check the post again now it is back to 0. do you know why?

    • Tom

      Can you fire me a URL for this. Did you update the permalinks structure of your site?

  13. David

    Nice plugin. I have it up and running at frontsidebus.net but I have one question. When pulling the widget using shortcode, how do you change the max age to one day? Thanks

    • Tom

      You can’t in the current version (1.1.0) – but you should have more options in 1.2.0 expected soon. :)

      • David

        That’s disappointing but understandable. I’ll be looking forward to the update.

  14. Dan Hatfield

    Thanks for getting back to me about my first question. I have another question/issue. On my site the widget only appears when using Firefox. It does not appear in Safari, Chrome, or IE. Any ideas?

    • Tom

      Do you have a URL where the widget should I could look at so I can test this? Sounds very odd!

  15. Phat^Trance

    Theres something wrong with the latest plugin, it doesnt count all my popular posts and the counter seems to be stuck at 120 facebook likes. i have over 50 posts with over 2000 likes and the plugin havent found any one them :)

    • Tom

      Thanks for your reply to my email. I’m looking into this! :)

  16. Frank

    Hi,
    you wrote in your changelog: “Added a shortcode option to include within posts/pages.”

    Where can I find the shortcode to add manually the buttons?

    Greetings
    Frank

    • Tom

      Hi Frank,

      There is a section in the FAQ above. The code should look:

      [most-shared-posts num_posts="5" max_month_age="24" title="Most Shared Posts"]

      I’m going to add some more options in the next update. :)

  17. Cynthia (@cynthiasantos)

    Hi, there!
    I’ve installed the plugin last night, and so far, nothing appeared at the share counts. I have 226 posts published, ill it take longer to show the counts, or it might have something wrong?
    Thank’s for your attention!

  18. Cynthia (@cynthiasantos)

    Hi again…now I’m having some issues with FB and TT API’s: “PHP Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http%3A%2F%2Feulalios.net%2Feueeu%2Findex.php%2F2010%2F06%2F24%2Farthur-o-conquistador%2F) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in E:\home\eulalios5\Web\EueEu\wp-content\plugins\most-shared-posts\msp-fetch.php on line 121
    PHP Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in E:\home\eulalios5\Web\EueEu\wp-content\plugins\most-shared-posts\msp-fetch.php on line 179″

    • Tom

      Hi Cynthia,

      It seems that your hosting setup disallows the function I am using to access the social APIs. However, in the next release I change the way I do this, and I think it may solve your problem. I’m working hard on the update and will release it soon. I’ll fire you an email when it is ready and you will hopefully find it helps!

  19. Cynthia (@cynthiasantos)

    Ok, thank’s a lot! Looking forward to have it working at my blog!

  20. James

    Hi, I was wondering if I could do this plugin for a list of (children) pages, shown on a page instead of posts on a sidebar?

    • Emanuele

      I have the same doubt James!
      If you discover, can you tell me? :)

      Thanks ;*

      • uggs outlet

        Read a lot of similar articles, but only found this article to my taste, thank you

  21. rei125

    i was looking for this plugin!!
    Thanks!
    i just downloaded it and checked on my “Most Shared Posts” statistics..
    but they counts are not correct…
    is it that i need some time for it to get the correct statistics?
    it has been 30mins since i activated it..

    thank you.

    • rei125

      it has been one day but the figures are not correct, yes those with “like” are summed correctly but those post without “like” also turns out to be “1″..

  22. Stock Market

    very good post, i was really searching for this topic as i wanted this topic to understand completely and it is also very rare in internet that is why it was very difficult to understand

    thank you for sharing this.

    Regard

    Stock Market

  23. Adam

    Great plugin. I have been looking for something like this for a couple of weeks. Hope it works well with my site. I have a couple of ideas I want to try.
    Thanks!

  24. Plop

    Hello,
    this plugin works very well, congrats!
    But I’m looking for a way to display the most shared posts in a box with 2 tabs (one for the most read posts, the other for the most shared posts). Is it possible ?
    Any help is welcome :)

  25. Emanuele

    Hey Tom, I’m having a problem here.
    I have this site http://www.feedbusiness.com.br/ it’s offline to the public yet, but I installed the plugin and I’ve set the widget to show the “Most Shared Post” at index.
    Every day I share more than 3 posts, but I take care to share, at least, one of the most shared.

    The problem is: the admin page shows ZERO votes to all the posts. What I’m doing wrong?
    I use the addthis and sharethis plugin’s to wordpress. ShareThis is installed, and addThis is the code of site.

    Can be a conflit problem? Or need a minimum number of shared posts?

    tks, anyway.

  26. Gold Silver Tips

    Very good post, i was really searching for this topic as i wanted this topic to understand completely and it is also very rare in internet that is why it was very difficult to understand.
    Thank you for sharing this information.
    Regard
    Gold Silver Tips

  27. Rey

    I installed the plugin but nothing icon shows in my post. sir do you know where or what would be wrong?

  28. Gold Silver Tips

    I read your post that’s really useful information about the market.I really appreciate your post and you explain each and every point very well.Thanks for sharing this information.

    Regards

    Gold Silver Tips

  29. Intrday Tips

    Excellent and informative tips.I like your post and it really gives an outstanding idea that is very helpful for all the people on web.
    Intraday Tips

  30. flo

    Excellent plugin

    Could you tell me if exist a shortcode to include share results without widget ? for example : in my sidebar ? i don’t tell about [most-shared-posts num_posts="5" max_month_age="24" title="Most Shared ] in a post

    Thks in advance

  31. lwen

    Hi Tom, I activated the plugin and display it on the widget area but it only displays title of the widget. I have social share icons installed, but the plugin didn’t display the most share articles.

  32. camera store

    Good news.This is a great post. I like this topic.This site has lots of advantage. I found many interesting things from this site. It helps me many away..So i want some information for sharing this side with some of my friend. Thanks

  33. Sern

    Hi Tom, I just install your plugin Version 1.1.0 in my WordPress 3.2.1.

    My website have about 600 posts and i already install this plugin for about 36 hours.

    when i click ‘Your Most Shared Posts’, it still show no post in this page.

    May i know why??

  34. mcx tips

    Excellent and informative tips.I like your post and it really gives an outstanding idea that is very helpful for all the people on web.
    mcx tips

  35. Mcx Tips

    I really appreciate your post and you explain each and every point very well.Thanks for sharing this information.And I’ll love to read your next post too.

    Regards

    Mcx Tips

  36. indian stock market tips

    This post is really nice and informative. The explanation given is really comprehensive and informative. I am feeling happy to comment on this post. I think this is useful information for users-How does the ordinary investor fit into the equation comprising of global factors coupled with manipulation in the stock markets.
    indian stock market tips

  37. LOL pics

    Hey Tom,
    i need a little help here. I am using taxonomies, and i cannot make it work.
    I installed it, added ‘post_type’ => ‘any’ in msp-fetch.php, so it looks like:

     $args = array(
        'posts_per_page' => 500,
        'orderby' => 'date',
        'order' => 'DESC',
        'ignore_sticky_posts' => 1,
        'post_type' => 'any'
      ); 

    And after few days, there is no posts fetched.
    Have i missed something?
    Thanks
    Dusan

  38. Fred

    Tell me how to get the plugin without the widget in the sidebar with the output of the function?

  39. Jason Cairns

    Is there any way to pull the image from the post to be displayed next to the article/post title? Cheers :)

  40. jnreyt

    Hi! Thanks a lot for the great plugin. I see you have linkedin in your version of most shared posts. Is it possible to have that in the wordpress plugin?
    Cheers

  41. Chris

    Dude, rockin’ plugin! I’m with jnreyt, how do I go about adding another service, like Digg or Stumbleupon?

  42. Gem

    Hi Tom,

    I think you have made a wonderful plugin. :-)

    However, I have some issues with Google Webmasters Tools which I have traced and seen that it was caused by your plugin. A line from Google Webmasters Tools:

    http://www.yournextshoes.com/2011/07/clemence-poesy-nina-ricci-black-platform-wedges/function.file-get-contents

    Clicking on that file shows 404 error.

    When I checked my web hosts’ error_log I saw the errors which came from your plugin.

    Line 1807: [13-Nov-2011 17:52:08] PHP Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http%3A%2F%2Fwww.yournextshoes.com%2F2011%2F11%2Fshop-neiman-marcus-call-sale-40%2F) [function.file-get-contents]: failed to open stream: Connection timed out in /home/ynextsho/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 121

    I have read through the installation instrucitons, FAQ, and the comments here. I hope the error was not caused by anything I’ve missed during setup.

    The errors aren’t visible for the visitor. All the errors are seen on the backend.

    In case you are interested where I’ve placed your plugin, it only shows on pages for now.
    http://www.yournextshoes.com/about/

    I hope you could look into this issue?

    Thank you and good day.

  43. Houston Home Security

    Well worth to read this article, thanks for sharing this information. With this article you offered me got a chance to know about this, anyway i say Great Article! I’m waiting for you next article about this interesting subject.

  44. MCX Today

    yes its boost our keyword rank….

  45. fdsfdsfds

    nike tn femme

  46. radyo dinle

    Very interesting and insightful. Thanks for sharing it with us.

  47. Rob Cottingham

    Terrific plugin – I can’t wait to get it working. My main problem is that I’m running the Webcomic plugin, which uses a custom post type. Any chance you’re likely to support custom post types any time soon?

  48. gucci outlet

    I am curious how come I didn’t find this blog before.

  49. Sandra

    Hi, a great plugin! But how long can it take to display the shares? I have installed 3 days ago – all that’s shown until now are 3 posts with a few google +1 shares – no facebook and no twitter yet. Is it possible that it’s still working? Or is something maybe going wrong?

  50. carsten

    Great plugin, but same problem here: the google+ counter works, but no counts (not even a zero) for the other ones. Could it be that a caching plugin of some sort is interfering?

    By the way, adding counts for linkedin would make this plugin even more complete :)

Leave A Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>