Top 10 Posts hack for WordPress

January 19th, 2004
WordPress Hack

I really liked the “Top 10 Posts” on Jeremy Zawodny’s Blog and wanted it for mine as well. So I wrote a small hack which keeps track of the number of times a particular post is clicked on (using the database) and then makes a list of these posts with the number of clickthroughs. You can see it in work on the sidebar. Here is a link to the hack instructions. This is WordPress 0.72 and 1.0+ compatible.




  1. Jerome (1 comments.) says:

    In the first place, does this work with WP 1.2?
    Is this compatible with Alex King’s Since-last-visit plugin?
    Becos i got error msgs on my test site

  2. Scott (1 comments.) says:

    I am apparently incapable of making this work in 1.5. I’ve got all the code in place, but the thing will not populate the mySQL table. Any help?

  3. Brandon (1 comments.) says:

    I’ve got this up and running just fine on 1.5.whatever, does it work on 2.0???

  4. Jeff (1 comments.) says:

    Help help help… I’m pretty challenged here. I don’t know how, where, or why to enter the values in the SQL database. I got there, but don’t know what to do.

    If you could email, I could send you a screen shot of what I’m messing with.


  5. 24FightingChickens (1 comments.) says:

    Your plugin installation routine has a major bug. When it creates the table, it does not create the post_id field as unique, so some posts get multiple entries in the listing, and the top 10 list starts looking like a top three list with duplicates in it.

    I went into MySQL and manually set the field to unique, which exposed the duplicate entries when it threw an error. I deleted each dupe, and then was able to set it to unique.

    After that, it works fine.

    Answers to above questions:

    #4 – You did not activate the plugin. Go into your admin panel, choose plugins, and click on the activate link to the right.

    #6. I recommend against running WordPress 2.0. The differences between it and WordPress 1.5.3 are all klugey, bandwidth hogging nonsense that no one really needs.

    #7. You don’t have to enter any values in the MySQL database. I’m sorry to be so blunt, but when you find yourself asking such basic questions, it means you are not technical enough to install and manage this plugin.

    Everyone wants their blog to have cool gizmos on it. But most people really are not qualified to install them, fix them, or operate them. And installing something like this, if you cannot read the code, could create a huge security gap in your blog that you cannot close which allows a hacker to run wild. So, if you cannot read basic PHP code, just stay away from plugins like this one if you find yourself getting confused or stuck.


  1. WordPress 1.2 beta
    This blog is now running the WordPress 1.2 beta. I had some problems after upgrading from my good old 1.0.2 copy, especially with the BBCode and the smilies. I still haven’t got the “Reads hack” working again though…

  2. […] 1.0.2 copy, especially with the BBCode and the smilies. Still haven’t got the “Reads hack” working again… It seems to work *so […]

  3. […] Neben einigen Kleinigkeiten und diesem Linktipp habe ich in dieser produktiven Mittagspause eine wirklich nette Neuerung für Omahabesucher. Und zwar findet ihr im Sidebar nun ein Feature welches die Popularität der einzelnen Posts und Künstlerseiten auf Omaha misst. Wers auch haben will, hier gibts Top 10-Plugin für WordPress. […]

Obviously Powered by WordPress. © 2003-2013

page counter