Skip to main content

2 posts tagged with "docusaurus"

View All Tags

Add Disqus Comments to Docusaurus Blog Posts in 2025

· 6 min read
Andre Roussakoff
Maintainer of this blog

TL;DR In my previous, now archived, article Add Disqus Comments to Docusaurus Blog Posts (archived) in 2021, I have discussed how to add the Disqus blog comments to a Docusaurus blog. At the time, Docusaurus was in the beta of v2.0.0, React was in v17, and I have used the JavaScript version of swizzling. But the trick I used gained some attention and there were several very inspiring comments, which you can see there. Unfortunately, due to my personal situation I have not acted on them. Until now!

UPDATED May 23, 2025

In this article you can read how Disqus comments can be added today, in 2025 using the latest and the greatest Docusaurus 3.8.0, React 18 or 19, and TypeScript instead of JavaScript. Of course, if your project needs JavaScript, you can just omit the types.

Add Disqus Comments to Docusaurus Blog Posts (archived)

· 6 min read
Andre Roussakoff
Maintainer of this blog

TL;DR Recently I have switched from Jekyll to Docusaurus for my personal website. And immediately noticed the issue with letting the visitors place comments to blog posts. It seems that the comments work out of the box only for Facebook comments and then only if one has a registered FB business site (according to this PR). Searching on adding e.g. Disqus blog comments in Docusaurus brought back more questions than answers. (see some references at the end of this post)

The closest I could get to the solution was How to add forum to Docusaurus using Utterances comments via GitHub issues. I got the gist but the vendor binding was too big to my taste.

So, I have made my own go on this issue and finally succeeded in adding the Disqus blog comments to my Docusaurus blog. In this blog post you can see them in action and also read how I did it. I hope it might help some of you to do the same on yours.

UPDATED July 12, 2022

The code examples are compatible with Docusaurus 2.0.0-beta.16 and higher