Fix WordPress comment count error caused by Disqus plugin

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
May 28, 2011

Disqus for WordPress is a great plugin for those who want to integrate a better way of adding comments to their blogs. With Disqus, you can allow your visitors to easily post comments through their Facebook or Twitter accounts. Disqus perfectly syncs with WordPress comment system and the comment on your database is also synced with Disqus’ server. But with the latest version of WordPress i.e. WordPress 3.1, Disqus has some issues showing the comment counts for the post. Here is how you can fix comment count error in WordPress 3.1 when Disqus plugin is used.

After upgrading to WordPress 3.1, you would encounter a strange error in the post list area instead of the comment count. This would happen only if you have Disqus plugin for WordPress installed. The error looks something like this:

Warning: number_format() expects parameter 1 to be double, string given in /wp-includes/functions.php on line 155

Disqus comment system

This error occurs because Disqus’ comment count system uses its own value for counting comments that breaks WordPress’s default function number_format_il8n(). This function expects the comment number value to be a double instead of a string. So, we’ll have to edit a file on Disqus plugin folder.

Open the file /wp-content/plugins/disqus-comment-system/disqus.php. Now find the following line of code on your text editor.

[code]function dsq_comments_number($count)[/code]

Your code will look something like this:

function dsq_comments_number($count) {
global $post;

if ( dsq_can_replace() ) {
return ‘<span class="dsq-postid" rel="’.htmlspecialchars(dsq_identifier_for_post($post)).’">’.$count.'</span>’;
} else {
return $count;

Simply replace the above code with the following.

function dsq_comments_number($count) {
global $post;

return $count;

This will do the trick to fix error in comment count on WordPress 3.1 due to Disqus plugin.

You may also like...

  • Anonymous

    Thanks so much for this! I’ve just spent an hour trying to fix it as realised it broke after upgrading.

  • Anonymous

    you’re welcome 😉

  • considering ditching disqus to use comment love and wordpress supported comments. pros? cons?

  • Anonymous

    disqus is the best option.

  • garth ethan

    Well, This is good and interesting software review.


  • Anonymous


  • well i have face the same problem but rectified it by re-installing the plugin

  • Anonymous

    the latest version fixes the issue.

  • Anonymous

    actually disqus makes commenting more easy as people can easily comment to
    your blogs using twitter or facebook accounts.

  • Generic Viagra

    Ditching Disqus considering the use of love comments and WordPress supported comment. pros? disadvantages?

  • 年 冯

    A wide range of Australian made UGG Boots and sheepskin leather products. Supra Shoes on hot sale now,we carry a large inventory from Supra Footwear, Including Supra Shoes,Supra Skytop And Supra Avenger,Supra Bandit,Supra Bullet.Huge Range, all with Fast, Free Delivery.
    Bryant, the gap in the purchase price of shoes in! Zoom discounts and cheap to buy the lowest price every day Kobe Shoes.Huge Puma Trainers Range at LQshoes Massive Sale Now On. Free Delivery to UK USA Canada… Buy Cheap Puma Shoes at Puma Shoes Online Store Now!Wholesale Authentic NFL Jerseys,Contain mens,womens and youths Cheap NFL Jerseys,Welcome to buy.Inc sell cheap Sunglasses,is a Oakley Sunglasses reseller store, Oakley NFL eyeglasses are sold as a cheap price.!NFL Cap.

  • Accelerated Learning

    Disqus is easy to use and it has the tagging feature. So Disqus is okay to use.

  • i am using it. it is really easy to use


    Oscillating Saw Blades[/URL]

  • This article adds to my knowledge
    Pengertian Amazing

  • goodman

    My name is Patrician Soon ,am from Malaysia but i work and live Singapore last Month i was in need of loan ,and i contact two loan companies where i got ripped off over $3,000 SGD and i swear never to involve myself in such a sleazy game again until a good friend of mine in Singapore Susan Lim referred me to a very reliable loan company .i just applied for a loan of $40,000 SGD in less than 4hrs and my loan was approved and transfers to me so am using this medium to referred all loan seekers to this loan company. you can reached them by email

  • goodman

    Need urgent loan to solve your financial needs, we offer reliable loan at an interest rate applicable to all loans is (3%), if you are interested contact us via ( with the information below
    Your full name: _____
    Country: _____
    City: _____
    Address: _____
    Amount Needed: _____
    duration: _____
    Loan Purpose: _____
    Monthly income: _____
    Age: _____
    Sex: _____
    Occupation: _____
    Telephone number: _____
    Mr Marsha Goodman

  • goodman

    I am a private loan lender which have all take to be a genuine lender i give out the best loan to my client at a very convenient rate.The interest rate of this loan is 3%.i give out loan to public and private individuals.the maximum amount i give out in this loan is $1,000,000.00 USD why the minimum amount i give out is 5000.for more information contact us email
    Your Full Details:
    Full Name :………
    Country :………….
    Sex :………….
    Tel :………….
    Occupation :……..
    Amount Required :…………
    Purpose of the Loan :……..
    Loan Duration :…………
    Phone Number :………


    A bad credit history shouldn’t deter you from reaching out to a loan company if you are need of fast approval for a cash loan. Securing a fast cash loan when you have bad credit isn’t out of the question if you know who to turn to when financial times are tight. With so many consumer finance companies from which to choose from, make sure you choose a lender that has an established reputation. At Citizens Savings & Loan, we have been in the business of making loans to individuals of doing business, we have worked with a myriad of personal financial needs and have helped countless individuals reach their financial goals. contact us: ( )


    When your financial situation gets out of hand and when friends and family not in a position to help you out, you turn to banks. When your not so fabulous credit report fail to give you a helping hand, Get the cash you need today! Unexpected expenses can arise at just about any time. This is when a personal loan can come in handy. Often times you can apply for no credit check personal loans online. Unlike some companies we work with hundreds of lenders to match you up with the loan that meets your needs. We have the ability to offer no credit check loans contact email: ( )


    A bad credit history shouldn’t deter you from reaching out to a loan company if you are need of fast approval for a cash loan. Securing a fast cash loan when you have bad credit isn’t out of the question if you know who to turn to when financial times are tight. With so many consumer finance companies from which to choose from, make sure you choose a lender that has an established reputation. At Citizens Savings & Loan, we have been in the business of making loans to individuals of doing business, we have worked with a myriad of personal financial needs and have helped countless individuals reach their financial goals. contact us: ( )


    Are you looking for a very genuine loan?
    Do you want financial assistance in your business?
    Do you want to buy your dream house and car?
    Do you want to start up a business and you dont know where to start from?
    Have you been turned down constantly by your banks and other financial institutions? worry no more because we give out loan At an affordable interest rate of 3%? Processed within 24 hours.and a repayment duration period of 1year to 30years to any part of the world.We give out loans within the range of 1,000 to 100,000,000 USD contact us: ( )


    i need a loan

  • Trimak Loan

    TESTIMONY ON HOW I GOT MY LOAN TO PAY MY BILLS My name is Anita Holloway. I live in USA California and i am a very happy woman today? I told my self that any Loan lender that could change my Life and that of my family, i will refer any person that is looking for loan to Them.They gave happiness and my family, i was in need of a loan of $250,000.00 to start my life all over as a widow with 2 kids I meant this honest and GOD fearing loan lending company online that helped me with a loan of $250,000.00 U.S. Dollar, They are indeed GOD fearing People, A reputable loan company. I am very happy i got loan from Trimak loan today just within 48 Hours. If you are in need of loan and you are 100% sure to pay back the loan please contact them and please tell them that Mrs, Anita sent you to them. contact via E_mail:

  • Matricia

    Hello Everyone, My names are Mrs Marticia Simons, i am from the United States of America, currently living in Oklahoma.i went in search for a loan on the internet , and the Lord lead me to a genuine loan lender, A Company of Fidelity Loan FInance.fidelityloanfinancial(AT)gmail(DOT)com, whom i contacted and requested for a loan amount of $45,000.00 dollars to establish a new business, and to my surprise i got my desired loan within 2 days(48 hours). While searching for a company to get a loan from, i read various testimonies of how people where scammed of their money,and i was scared.I am happy i came in contact with FIDELITY LOAN i humbly advice you in search of a genuine loan lender to quickly contact FIDELITY LOAN FINANCE via email:fidelityloanfinancial(AT)gmail(DOT)com and you will be as happy as i am.may the good lord bless them and reward them effortlessly for what they have done in my life. Indeed they are the best loan lenders.

  • mr Aderson

    We represent a Funding Source that shares the desire to engage in the high-risk, high-return potential business of “investment financing . Universal Loans is making large ring around the globe with the online finance, we provide capital to entrepreneurial companies and serious individuals who seek to make investments in the area of infrastructure and construction development such as Personal Loan, Business Loan, Mortage Loan, House Loan, or any kinds of loan required.
    We grant personal and Mortgage loan our interest rate is affordable at the rate of 2%. Our career has been built around leading and developing investments and projects, from ideal to successful launch and target driven performances. I urge you to come up with the detailed plan of any loan you would want us to finance. Email us for more info:

  • Karen Kesby

    Good Day,

    My name is Christine Holland i am a citizen of the United State of America i want to testify of the good Loan Lender who showed light to me after been scammed by 4 different Internet international lender, they all promise to give me a loan after making me pay a lot of fees which yield nothing and amounted to no positive result. i lost my hard earn money and it was a total of 8,000USD. One day as i was browsing through the internet looking frustrated when i came across a testimony man who was also scammed and eventually got linked to a legit loan company called Brooks Finance Loan ( where he finally got his loan, so i decided to contact the same loan company and then told them my story on how i have been scammed by 4 different lenders who did nothing but to course me more pain. I explain to the company by mail and all they told me was to cry no more because i will get my loan in their company and also i have made the right choice of contacting them. i filled the loan application form and proceeded with all that was requested of me and I was given a loan amount of $600,000.00 Dollars by this great Company (Brooks Finance Loan) managed by Mr Brooks Henry and here i am today happy with my family because Brooks Finance Loan has given me a loan so i made a vow to my self that i will keep testifying on the internet on how i got my loan. Do you need a loan urgently? kindly and quickly contact Brooks Finance Loan Ltd. now for your loan via email: ( i believe other people are also giving testimony on this same honest lender.

  • Robert nancy

    Hello My name is Nancy I want to thank Mrs Austin Kelvin Loan Fnancial for helping me with my loan funds of $70,000.00 if you are interested in a loan please contact he so that him can also help you too he loan do not take long in 24 hours time my loan was in my account anyone that need an urgent and trusted loan should contact he now him is a God sent and a good person he email is I am happy to write this here because this is the right loan company to contact.

  • Christine

    I can’t hide this great testimony that took place in my life, i will love everyone to know it and be partaker of it,that is why i want to share it to the whole world by placing this advert on classifieds adds. I am Christine by name, I live in Texas, USA. I want to thank Steve Wayne for his kindness upon my family life, I never knew that there is still a sincere and trustworthy lender like this on the internet and on earth. Just some days i was in search for a loan of $150,000.00 USD as I was running out of money for feeding, School fees, My business was really going out of capital and my rent because i am a single mother with 2 kids. I was scammed about $1500.00 USD and I decided not to involve myself in such business again. A Friend of mine introduced me to a loan agency due to my appearance and also my complains to her. I told her that I am not interested in any loan deal anymore,that i was scammed by some fake lenders on the internet,but she told me that there is still a sincere lender who she will recommend me to,and i will get the loan that i need, she gave me the details of this loan agency. I really put a trial and i am most grateful and lucky today, I was given a loan amount of $150,000.00 USD by this great loan agency called Steve Wayne Loan Company,managed by Mr Steve Wayne,If you are in need of a genuine, Sincere, durable and a trustworthy loan lender for financial assistance,and also you know you can be reliable and trusted, capable of paying back at the due / duration time of the funds, I will advise you to send your contact to them via emai( and you will experience sincerity and honesty.God bless you all..Christine…..

  • White Horse Credit

    Are you looking for financial freedom? are you in Debt, you need a loan to start a new business? or you collapse financially, you need a loan buying a car or a house? Have your bank in ever Finance refuse? You want to improve your financial? they need a loan your bills are paying off? not looking more, we welcome you for an opportunity to all types of loans get at a very affordable interest rates of 3% for other For information, contact us now by e-mail to: