How to Add Disqus Comments to Your Joomla Site Without Using an Extension

In this post I'm going to show you how to add Disqus (or pretty much any third party commenting system) to any part of your Joomla site without the need for modules or plugins.

How to add Diqus comments to Joomla without an extensions

Disqus is one of, if not the, most popular third party commenting systems available. It has some great features like the ability for users to post using their social media profiles, excellent spam protection, a central management dashboard, ability to "Like" comments, vote comments up or down, follow users Disqus profiles (here's mine) and share comments on social media.

First, let's address the elephant in the room. Why not use an extension?

I'm of the opinion that administrators should install as few extensions as they can. There's a number of reasons for this. 

  1. There's less for you to maintain and keep up to date.
  2. It reduces bloat and the amount of code running on your site.
  3. Fewer extensions == faster website.
  4. In this case, it's also quicker to do it manually than spend the time downloading and trialling a handful of extensions.

It all boils down to maintenance, security and performance.

With a plugin you are restricted to the functionality provided by the plugin. A Disqus plugin may add comments to your Joomla articles but does it work with your shop? Will it add commenting to your portfolio extension or your FocalPoint map locations?

If you use a module, it's display is linked to a menu item. A blog list and the individual posts themselves have the same menu id so you can't limit the comments to just the posts. To do that you'll need to install and configure an additional plugin like NoNumber's Advanced Module Manager. But, now you've got 2 modules to maintain and possibly subscription costs for pro versions. 

1. Create an account at Disqus and register your site.

Head on over to Disqus and create an account. Set up your site and configure all the options. I won't go through how to use the Disqus site. It's pretty straight forward.

When your account and site has been setup in the Disqus admin click Installation in the left sidebar.

Select the Universal Code option. There is a Joomla option that links to a plugin by JoomlaWorks. For this exercise we just want the code.

Copy the text from the first code block. This is the code that loads the Disqus system.

2. Add the Disqus code to the relevant templates using template overrides.

  1. Login to your Joomla installation and navigate to Extensions > Templates.
  2. Click the template link to the right of your selected site template.
  3. Open the Create Overrides tab. Create overrides of just the views you need. For example to add Disqus to our regular Joomla content but not category lists just click com_content > article. Create overrides for as many views as you need. For a more detailed description of creating overrides see my tutorial here
    template overrides 2
  4. Go back to the editor tab and you can now edit your newly created overrides via the administrator. In the /html folder you'll find your new files. Open default.php.
  5. Scroll to the very bottom of the code and paste the Disqus code just before the last closing tag. It's most probably </div>, </section> or </article>.
    Add Disqus code to the Joomla content template
  6. Click Save and Close.
  7. Repeat for any additional views.

Important Note: It's a good idea to first check that overrides don't already exist before creating them. Many template frameworks include overrides of com_content already.

You've got comments.

Go to your site's front end. Navigate to an article. At the bottom you'll see a brand new Disqus comments form.

By adding the code directly to your template  you get comments without any additional server side processing. In addition, you also have the flexibility to add comments to any component view you like.

John PitchersSince 2005, I've supported my family working from home building Joomla sites for paying clients.

If you're a first-time Joomla user, or building a freelance career of your own, I'm sharing everything I've learned one post at a time.

“My mission is to help you become the best Joomler you can be. Are you ready?



My Awesome Joomla Website