Removing Disqus Comments from WordPress Pages

Disqus is a nice little plugin if you want users to have an easy way to comment on your blog posts, if you are into that sort of thing. Personally I dislike commenting, but I work with a lot of clients who love it. To each their own. The biggest failure with the WordPress pluing for Disqus is by default it automatically shows on every page, post, anything. It's at the bottom always. Most of the time people only want comments on their Blog Posts and nothing more. Thankfully it's pretty easy to hack the plugin to work how you want it. First thing you'll want to do is fire up your FTP application or cPanel. I don't suggest editing the plugin via WordPress, for some reason it just never works correctly for me. Once in your WordPress FTP navigate to the following: /wp-content/plugins/disqus-comment-system Inside of the disqus plugin folder open the disqus.php file and search for the term "Filters/Actions" it should take you right where you need to be. Scroll down under the "Filters/Actions" headline and locate the following line of code:   `if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) { return; } if ( !dsq_is_installed() || !dsq_can_replace() ) { return $value; } `   Once you locate it, highlight it all and replace it with the following:   `if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) { return; } if ( !dsq_is_installed() || !dsq_can_replace() ) { return $value; } if ( ('closed' == $post->comment_status) || ('page' == $post->post_type)){ return; }` Save the changes to the disqus.php file and take a look at your WordPress site. You should be good to go! No more comments on pages!

This article is my 9th oldest. It is 291 words long, and it’s got 0 comments for now.