How To Display Your Feedburner Subscriber Count In Plain Text

You have likely noticed that many bloggers choose to display their RSS subscriber count on their blogs. The most common way to do that is by using the little button graphic which Feedburner provides.

A fancier way to do it is to display it in plain-text format, thereby allowing you to style it in whatever way suits your blog.

When I made some recent design changes to DavidRisley.com, I decided to display the FeedCount using plain text. Below is how I went about it…

#1 – Enable The Awareness API

First of all, you need to be using Feedburner for this approach to work. With that said, go into your Feedburner account, choose the right feed, then click on the “Publicize” tab.

On the right menu, you’ll see “Awareness API”. You want to go enable that.

Screen shot 2010-06-28 at 10.41.05 AM

#2 – Use this PHP Code

It takes a little bit of PHP wizardry to tap into the Feedburner API. So, what I did was use the following code and I placed it into a file all by itself. I called that file feed.php and I placed it into the same folder as my active theme. Here is that code:

<?php
$feedcount = get_option("feedrsscount");
if ($feedcount['lastcheck'] < (mktime()-3600)) {
//get cool feedburner count
$whaturl=https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=davidrisley;
//Initialize the Curl session
$ch = curl_init();
//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
$feedcount['count'] = number_format($fb);
//end get cool feedburner count
$feedcount['lastcheck'] = mktime();
update_option("feedrsscount",$feedcount);
}
echo $feedcount['count'];
?>

This code is designed to fetch the count and store it in your WordPress options table in the database. It will check the feed count once per hour. This saves server load of having to load up a remote URL on every page view. Quite frankly, it could probably be decreased because I think Feedburner only updates counts every 24 hours anyway. But, anywho… :)

One important thing is to modify the URL in the code above for your feed. Where you see “davidrisley”, you need to change that to be the identifier for your RSS feed. Basically, whatever comes AFTER the “http://feeds.feedburner.com/” in your Feedburner address is your feed ID.

So, once again, save that into a file called “feed.php” and place it into your theme folder via FTP.

#3 – Include the Code

The last part is simply to include feed.php in your theme wherever you want your feed count to display. Do this as follows:

<?php include(“feed.php”); ?>

That’s it. From there, you will need to do any styling of it on your own.

Bonus Tips

The obvious use of this is just to slap it in your blog’s sidebar. However, you can get a little more creative in your use of it.

Social proof is a huge concept in marketing. The idea that many other people do something makes it more likely a new person will do it, too. Call it “safety in numbers”, I guess.

So, you can use the feed count in order to add social proof to the idea of subscribing to your RSS feed or even your mailing list. Obviously, this is only going to work if you have a decent number of subscribers (perhaps 500 or more). Otherwise, it could work against you.

Tip #1:  Wherever you want to advertise your RSS feed, you could use the feed count to do something like “XXXX people subscribe to this”. It adds social proof.

Tip #2: If you set up a “blog broadcast” in Aweber and plug in the URL of your Feedburner feed, Aweber will report back your number of email subscribers to Feedburner and jack up your feed count. In this way, you can make the Feedburner count be more reflective of your EMAIL LIST than your RSS subscribers. Then, you could do the same thing, but instead draw people into your email list.

For example, here is a concept of something I’m working on for PCMech:

Screen shot 2010-06-28 at 10.59.02 AM

You might give it a try. But, certainly, this works a lot better when you can build the count right into your theme and avoid using that little chicklet button. :)

Hope you found that helpful. Let me know! And if you have any questions, post a comment.

Free eBook!

Like what you read?

If so, please join over 12,000 people who receive exclusive online business and blogging tips, and get a FREE COPY of my eBook, Six Figure Blogger Blueprint (PDF and MP3)! Just enter your name and email below:

  • http://impulsemagazine.net Impulse Magazine

    I don't think that the feedburner count matters anymore because it goes up and down a daily basis

  • http://www.nextlevelblogger.com/about Christian Russell

    That's a rockin tip David. Much appreciated! No way a dude like me can put together that php, but I've wanted to include a count like this. There are so many creative options if you can get away from that chicklet :-)

  • http://jimijones.com/ Jimi Jones

    Thanks David, quite helpful!
    I've been wanting to figure this out for some time and get away from the standard issue chicklets that Christian has mentioned. Makes for a more custom look.

  • http://davidrisley.com David Risley

    Yeah, it girates all over the place, that's for sure. However, there are some uses for it. I went for a long time not showing it on this site – mainly because I didn't think it mattered. But, kinda playing around with using it now. The big thing will be to test it out (split test) with some opt-in forms over on PCMech in a re-design I'm working on. :-)

  • http://erica.biz ericabiz

    Thanks. Very useful code!

    Unfortunately, my Feedburner count has been broken for months. It's not counting Google Reader subscribers accurately (of all things…aren't both owned by Google?!) Yesterday, for instance, it showed I had 2286 Google readers. Today it's showing 1301.

    Google has no support whatsoever and doesn't seem inclined to fix this (it's been reported a zillion times.) I'm really disappointed in them.

    -Erica

  • http://buyseopressor.com/ SEO Marc

    Hmmm, was wondering how that was done, FB does not give you a code to use, or it is not easy to find. Thanks David.

  • http://website-in-a-weekend.net/ Dave Doolin

    Mine is doing the same thing.

    As long as my AWeber count doesn't swing wildly (down), I can't I care overmuch. Still makes me feel bad.

  • http://website-in-a-weekend.net/ Dave Doolin

    Doggone it, Dave. I've been enjoying my unique status as the blogging about blogging blogger who actually knows how to cut code (which sucks down SERPs I might add). Now you go and ruin all my fun. Why, before you know it, that darn Erica Douglass might start posting code too. Dammit!

  • http://davidrisley.com David Risley

    You never know. Some of us know how to be code jockeys. :-)

  • http://davidrisley.com David Risley

    Yeah, I notice drops in my RSS count on days I don't post. I was assuming it had something to do with how many people are actually generating hits on the RSS feed, and it goes down on days I don't post. But, I have no idea. Feedburner is, at best, an indicator and not an exact number.

  • http://www.websitebegin.com Joe Boyle

    Great tutorial, David. I will be sure to do this once I get some free time, right after the 4th of July. :D

    I don't like the huge flashy buttons advertising the feedburner counts, so this will definitely help me add it to my site without wanting to remove it! Thanks!

  • http://www.bloggingteacher.com/?utm_source=comment&utm_medium=comment&utm_campaign=comment Paul Cunningham

    Thats very useful stuff. I also like the idea of combining multiple “subscriber” sources into a single count, like in this tutorial:

    http://tutorialzine.com/2010/05/showing-faceboo…

    Its an interesting technique but I guess you would need to be sure you display it in a genuine way not meant to trick people.

  • Fornacciari

    Thanks for the help, I was looking for something like this exactly. Anyway I just can't have it to work on my blog http://diariodetecnologia.com.br, I've follwed all the steps, inserted my feedburner's url and the php include code in the sidebar.php file…Any support i appreciated. Thanks in advance.

  • Flitz

    thanks a bunch. =]

  • Pixel Consultations

    I added the code and get Zero in the subscription number, do you have idea how to fix this?

  • http://www.comptricks.com/ Anupal Sharma

    nice thank you