Skip to content

Hide “0 Comments” link in WordPress when using the Disqus Plugin

“Google Fail” posts usually have absolutely nothing to do with what I normally blog about, but are attempts to fill gaps in the mighty collective internet knowledgebase. They are triggered by rare cases where Google has failed me in my search to find some piece of information, or easy instruction on how to do something, and I’ve had to solve the problem myself like in “the olden days” (with hardtack, and liberal application of cholera).

I’ve been using the excellent “Disqus” WordPress plugin for a number of websites, but have been increasingly frustrated that there didn’t appear to be an easy way to modify the shorthand comment count links that appeared in the themes (usually “0 Comments”, “1 Comment”, or “# Comments”). Traditionally in WordPress this would be done through simply modifying the comments_popup_link function in the theme. However because Disqus overwrites this link any customization to this function (like not displaying “0 Comments” at all) were ignored.

I tried adapting a little code snippit from this wordpress support forums thread:

<?php $comment_count = get_comment_count($post->ID); ?>

<?php if ($comment_count[‘approved’] > 0) : ?>(original comments_popup_link code here)<?php endif; ?>

(Because my Disqus synch’s comments with my WordPress installation “just in case” – basically put everything in a big IF statement so that the comments_popup_link is *only* written if at least one “approved” comment exists).

It actually worked pretty well except that it turns out that get_comment_count (and a lot of wordpress comment functionality) counts trackbacks and pingbacks towards comment totals. So even with “0 Comments”, a lot of posts had a $comment_count > 0. Yes there are customizations and plugins to deal with this – but that’s not exactly an elegant fix at that point (not that anything I do is usually ever “elegant”).

So what’s the solution?

Finally I had the head-smacking realization that if you just log into your dashboard on Disqus, select the “Settings” tab, and the “Appearance” category – voila – there is a “comment count link” section at the bottom that let’s you set custom text for “Zero Comments”, “One Comments” or “Multiple Comments”. And (facepalm) these settings are propagated to your WordPress site.

One final hurdle is that Disqus doesn’t seem to let you set the “Zero Comments” field to hide (in fact entering no value caused a pretty scary error message). But you can set that field to, the webmasters favourite hack: “&nbsp;” (a non breaking space) – which effectively hides the “0 Comments”.

See what I mean about not exactly being “elegant”? Shut up. It works.

  • Anonymous

    Hey, Your article.This information is obviously a
    great job. Thanks for the valuable information and knowledge that have
    forever here. Keep it up!
     

  • I really loved this post. You describe this topic perfectly. Great looking website really.

  • how can i hide disqus on specific page in wordpress
    OR
    show disqus only on posts in wordpress

  • Do you know how to customise the “Showing X comments”  label?

  • tinkererguy

    I noticed it took about 5 minutes for the change to Disqus to take effect on my site, but then, it worked!

    Minor nit:  I noticed if I hit F5 refresh on my page, tinkertry.com, , I can briefly see “0 comments” which it then quickly hides, not really a problem, it’s a momentary thing (happens in IE/Firefox/Chrome).

    However, I seem to have the little comment bubble comments.png show up, even for 0 comments pages.  Not a bit deal, just figured I”d ask if anybody figured out an easy/elegant way to discard those as well.  Tweak to postinfo.php or something?

  • Whenever disqus release a new version the downtime sucks but it would work fine after that. 

    However, I’ve read on another blog that disqus is selling users’ data to third party. That would be a big #fail. I hope they don’t do that

  •  
    It is possible to find these old and rare collectible comics on eBay, but you should note that the bidding is always fierce. As a buyer, you should also note that the quality of these comics is generally a guessing game. You can also find other sites with a wide range of books which are not only indexed in alphabetical order, but also provides the grade for the condition of the book. There is also a Superman #4 for sale with a price $495 in fair condition. A lot of the comic books on some of these sites are below $50. Perhaps the most expensive comic for Superman is ranked #7 with very good condition and priced at $795. There is also Superman #291 in poor condition, plus it’s a Mexican copy selling for $2

  • Thanks for the nbsp; tip!

  • Fantastics Advice, I have found the solution for time, Really thank you blogger

  • Hi,
    Very informative article. I’m gonna use this one for sure.Keep sharing continue.

  • Wow!This is a great summary of simple action items that marketers ought to
    enforce to keep their working.Keep writing continue.

  • 154443
  • Wow!This is good info. I was getting ready to switch over one of my sites to Disqus.Well done.Keep sharing continue.

  • Wow!This is good info. I was getting ready to switch over one of my sites to Disqus.Well done.

  • Thanks!Very informative and well written article. It contains lot of info. Thanks for sharing.

  • Anonymous

    I tried this, disqus is installed and works, but I still see “0 comments” in my posts and blogs etc. I put in the ” ” in the zero comments field and it still says “0 comments” please assist. http://www.djshorte.com scroll down to see the problem in my posts.

  • Wow!This is good info. I was getting ready to switch over one of my sites to Disqus.Well done.Keep sharing continue.

  • Woooo! This is great! I’m loving it. Is there a place where I can share
    mine. You’re doing a great job. You really have a future ahead of you!
    Can’t wait to read more! Thanks!

  • Hamza Sajjad

    wow……! good job

  • Using Disqus with your website gives you a fully-featured comment
    system, social network integrations, advanced administration and
    moderation, and other extensive community functionality. Most
    importantly, with Disqus your website is plugged into a web-wide
    community network, connecting millions of global audiences to your small
    blog or large media hub.
     

  • They triggered a rare case, Google has not in my search, I found some of the information sheet, or how easy instructions, I have solved the problem, its like in the past.

  • Of course, you can see from the comments in this article that having Disqus you do tend to get a pretty large portion of spanners telling you how you should keep it up with a link to something crazy.

  • Thanks, i didnt notice of that function of Disqus.

  • Presentation of a website is a crucial factor that the developer or owner must think about. The look of a website depends much on the design of it. Therefore, website design has become a matter of huge importance for the website designers or developers.

  • I am new in blogging therefore i am not much aware about it..This post shares very useful information regarding wordpress plugins which i am not aware of..Its my good luck that i visited this website and come to know about it..

  • Hello friend!!
    I have no doubt on your writing.Definitely given me something to think about.I get it clear idea about your topic.Most of the people looking this kind of valuable tips.

  • Hello friend!!
    I read this post very deeply.You blog is absolutely fantastic as there are lots of great information. I really appreciate the kind of topics you post here.

  • It is a well executed post. I like the diagram most. It is a
    helpful informative post. Thanks for sharing this great information.
     

  • Hi,
    this is a nice post thanks for sharing. really helped a lot here.

  • Hello friend!!
    Many thanks for this type of excellent article coupled with the review, I are 100 % fascinated! Hold stuff like this on its way. Thanks for sharing, I am using disqussince long time. It is vest blog commenting site.

  • It works like a charm. I will keep it on my blog.

  • Hello friends!!
    This is really good stuff here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming..

  • Thanks so much for sharing this. I’ve already spent too much time digging through the Plugin’s code. You’d never expect to find these kinds of settings in the Config panel..!?

  • Great work, Thanks.

  • robertrizzo

    Great hack! Thanks!
    I changed the O comments to “Be the first to comment!”
     

  • Thanks man, it worked great! 😉

  • Looks like this is not working on the 2012 disqus version, isn´t it?

    Thanks

  •  Hi Darkpollo – the setting is still there, just arranged a little differently.
     Click on the “Settings” tab,  then the “Appearance” sub-tab. At the bottom of the list are the “Comment Count Link” options.

  • But I do not have any appeareance tab…

  •  It should be there… you need to be on the disqus admin panel on *their* site, not your wordpress site. See the image below.

  • I am telling you. That is not the 2012 disqus. This is what i see: http://awesomescreenshot.com/087t4t9b8

    In your screenshot you can see the yellow ad telling you to try the 2012 Disqus. 😛

  • Yeah, I’ve just never disabled the pop-up. But you’re correct I had it temporarily turned off for the site! 🙂 This Disqus team are having some trouble making this feature available in the 2012 interface it looks like. They recommend turning off “2012” mode temporarily, entering the information in the old interface (as above) and then enabling “2012” mode again. The changes you make will carry over until they fix whatever the problem is (so they say). Here’s a couple of links I found on this:

    http://stackoverflow.com/a/11252279

    http://help.disqus.com/customer/portal/articles/708758-how-to-enable-settings-missing-from-disqus-2012

    Hope that helps.

  • Well, yes. I was thinking to try that myself. 🙂
    thanks
    I am sure this will help others with the new version. By the way, why are not you using the 2012 version? Any reason for that?

  • No real objection, just a lack of time to “tinker” with this site. After the third or forth time you completely break a site by upgrading something that was working just fine, you get a little nervous about experimenting unless there’s lots of free time in case something goes wrong.

    Generally, unless I’ve been dying for a killer feature, I’ll let other folks work the kinks out of new revisions of software for as long as possible, and then do a bunch of upgrades all at once. I don’t track the Trunk version of WordPress for the same reason.

  • I know that feeling. 🙂 I have a test/dev copy of my blog for those changes.
    Thanks. 

  • Guest

    thanks! now it works 

  • nociouz

    not working for me

  • kate_lee0121

    thanks for this information!

    Kate
    http://www.n8fan.net