How to Load Disqus Comments on Click
The comments on my website are powered by Disqus, the most popular commenting platform that offers a lot more features than what the native commenting engines of Blogger or WordPress have to offer. For instance, Disqus lets me moderate discussions or reply to comments via email itself and commenters can use their existing Facebook or Twitter accounts to sign-in for commenting on web pages.
Step 1: Go to your web page template that has Disqus and replace the #disqus_thread
<div> with the following snippet:
<div id="disqus_thread"> <a href="#" onclick="disqus();return false;">Show Comments</a> </div>
Step 2: Next place the Disqus code before the close
<head> tag of your web page. You’ll have to replace the disqus variables - like disqus_shortname, disqus_url, etc. - with your own parameters.
The page will have a “Show Comments” button and the comments are only loaded when the button is clicked.
Place this snippet near the closing
</body> tag of your page.
Google Developer Expert, Google Cloud Champion
Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.