Display Number of Twitter, Facebook and RSS Subscribers

There's so many social networks that we need to work with now

As you begin to build a build of a subscriber, it may become desirable to start displaying your follower numbers from several avenues, such as your Twitter followers, Facebook fans or your RSS subscribers. It lends some credibility to your site, showing that you’ve already built a decent reader base.

I decided that it was about time that I did this on Do It With WordPress, for the experience (and this tutorial) if nothing else. It actually wasn’t as easy to come up with this information as I had hoped, so I ended up largely crafting these snippets myself to get it just the way I wanted.

Twitter followers

To display your Twitter followers as plain text in your theme, you first need to insert this code into your functionality plugin:

There’s only one thing to configure in this snippet; sometimes retrieving the value will fail, so I’ve created a failsafe (512), which it will resort to in the event of not being to retrieve the actual number. You could either use an approximate number of followers, or create a little error message. It’s up to you.

Then to actually display the number in your theme, edit the theme file where the number needs to appear and insert the following snippet in the correct location, being sure to use the Twitter username that you’re actually interested in (instead of daclements):

Facebook Fans

To get the number of Facebook fans from your Facebook fan page, we take a similar approach; initially, you need to paste the following snippet into your functionality plugin (thanks to Kevin Chard for the basis of this snippet):

Facebook Fan Page IDIn this instance, there’s nothing to edit in the snippet above. Once that’s in place, paste the following snippet wherever you want the count to appear. You’ll need to switch out the fan page number for your own page, which can be found in the URL of your Facebook fan page:

RSS (FeedBurner) Subscribers

If you run your RSS feed through FeedBurner, you can use this little snippet to show the number of subscribers you have. First of all, you need to go into FeedBurner and make sure that you have the Awareness API activated; without it, you won’t be able to get the subscriber count.

Once that’s handled, paste the following snippet into your functionality plugin:

Then, in order to show off your subscriber count, just paste the following little snippet in the relevant theme file and change the FeedBurner ID (mine is wanderingbrit in the following snippet) so that you’re taking the number from your own RSS feed instead of mine:

So, that’s it. Pretty simple huh? What other services would you be interested in getting such stats from? Would you find it beneficial to incorporate this into a plugin (I might consider it)?

UPDATE: I found a decent plugin which largely achieves the same functionality. You need to create a widget and use a shortcode to display each value, but if all of this code scares you, it’s a viable alternative. It hasn’t been updated in a while, but I tested it on 3.2.1 and it’s working just fine. Download Subscribers Text Counter

13 thoughts on “Display Number of Twitter, Facebook and RSS Subscribers”

  1. John Hunter says:

    Do you know a way of getting the Google Reader stats instead of feedburner. I don’t like feedburner (though I do admit they have gotten rid of some of the worst parts) so I don’t use it. I can see my stats for Google Reader subscribers by manually looking (search to add feeds and it shows you feeds with the number of subscribers via Google Reader).

    1. John,

      I had a quick look around to see if there was a way to pull this number from Google, but it wasn’t immediately apparent to me, so in short, I’m afraid I do not!

  2. Tory McBroom says:

    Just a little tip if your embarrassed to display your RSS subscriber count because of a low number of subscribers, if you use AWeber you can connect that with your feedburner account and all of your AWeber subscribers will count as RSS subscribers. If you have a decent sized list that should really bump up your RSS subscriber count. :)

    1. Of course, if you’re embarrassed, you could always just lie, but then, what’s the point?

    2. David Walker says:

      Tory! That’s awesome. Brilliant. I never realized that you could do that. I will have to look into that, if not for me, I do know a few people that will really appreciate that tip. @Dave, thanks for the easy to understand code and how to use it! Anything maybe for Google Plus? ~David Walker

      1. David, are you looking for the number of people that follow you on Google+?

  3. I’d always wondered how that was done.

    Thought I have to wonder, and ask. Is there any point to it or is it just a way of showing off?

    I have a feeling that showing that people are already following you on these services will encourage others to join…I have to do some research on this!

    1. Well, there’s definitely two ways to view it and I can certainly see it from both sides. It could certainly be perceived as showing off, but looking at it another way, it is a way of giving potential subscribers that you’ve got a sizeable following, which is obviously a good thing. If you’re just talking crap all the time, you clearly won’t have any followers, so it can be the thing that eases a potential subscriber into hitting the follow button.

      Thanks for your input.

  4. Jim Calaman says:

    In these times, when Google seems to be valuing social interaction more in the Serps, I think it will help to have this information. I definitely feel you need to also add Google Plus 1 as it will be the most favored son as we move forward.

    1. Hi Jim,

      Well, I agree that Google is tying social sites more closely to your site’s rankings and anyway to advance your online presence, whether your own site, or your social media pages can only be a positive thing, and if doing this helps convert more readers, then that’s a good thing.

  5. Thanks for this. Way better to get the facebook fan count this way and cache it and make your own facebook like image button than use the facebook js code. It slows down sites so much.

    1. Agreed. In general, I try and avoid Javascript as much as possible, as it’s so bulky, to if I can make it on my own, I’d much rather do that.

  6. This is a real double edged sword of me. You really need social interaction but the various codes take so long to load. I have to use them but they slow my site down so much. Feels like gaining with one hand and taking away with the other. Talking of Google+ I notice they rolled out vanity URLs to everyone yesterday. Handy for branding if that’s important to people.

Leave a Reply