How To Get Rid of Disqus on Pages

I told some people on Twitter that if I ever figured out how to do this, I’d write a post about it.

So when you install Disqus on your blog, everything is spectacular…until you look on your pages and see a big, glaring, yellow box with “Comments are closed on this post” (or whatever it says). It’s obnoxious, and it’s ugly, and no matter what you do, you can’t disable it.

Well, I hacked some PHP and found a solution.

  1. Go to the “disqus.php” file (in the plugins folder).
  2. Find this line in the file (CTRL+F):  if ( ! (is_single() || is_page() || $withcomments) ) {
  3. Replace that line with this:  if ( ! (is_single()|| $withcomments) ) {
  4. Save the file.

Voila. The annoying yellow box (and all Disqus content) is gone on all pages (because you deleted the || is_page() code). Of course, now I have the default WordPress “Comments on this entry are closed.” message there. But that’s far less annoying (in my opinion).

This leaves everything intact for posts, so you shouldn’t have any troubles there.

I don’t think this is a permanent solution. I think that Disqus is planning on addressing this issue in a future update. But for now, it gets the job done.

  • Share/Bookmark

If you liked this, you might also enjoy...

  1. How to Point WordPress Pages or Posts to an External URL

View Comments to How To Get Rid of Disqus on Pages
  1. Johnluffa
    December 8, 2009 | 9:59 AM

    Thanks for sharing this Lisa – Great Tip and a big time saver.
    I have a few pages with 'Comments Closed' notification too, but never made time to address it.

    Cheers

  2. r3bb
    January 19, 2010 | 9:52 PM

    Thanks Lisa, I just applied your fix to my blog, http://www.corysstory.com and it worked like a charm. Connecting with you on Twitter now (@JaysonDeMers)…

  3. r3bb
    January 20, 2010 | 4:52 AM

    Thanks Lisa, I just applied your fix to my blog, http://www.corysstory.com and it worked like a charm. Connecting with you on Twitter now (@JaysonDeMers)…

  4. Kayla Miller
    March 12, 2010 | 3:47 PM

    Disqus has been monitoring and making improvements in the way spam is recognized and reported. Last Monday, they made some significant changes to help remove undesirable content globally on Disqus.

  5. Clarissa Young
    March 29, 2010 | 9:50 PM

    Disqus now brings us the ability to comment using your Twitter account. You don’t have to give up your actual Twitter credentials since Disqus takes advantage of Twitter’s support..

  6. Maryam Rivera
    March 30, 2010 | 6:06 PM

    Simply superb ! the best tool for comments and also for an back links no one can beat disqus system.

Leave a Reply


Wanting to leave an <em>phasis on your comment?

Trackback URL http://LisaMorosky.com/2009/12/how-to-get-rid-of-disqus-on-pages/trackback/
blog comments powered by Disqus