Back to blog

How to Add Comments to Any Website (2026 Guide)

Add a privacy-first comment system to any blog, docs site, or web app — WordPress, Ghost, Webflow, Astro, Hugo, Shopify, Squarespace, or hand-written HTML — with a single script tag. Step-by-step walkthroughs and an FAQ.

Introduction: Add a comment system to any website in under five minutes

Most blogs, documentation sites, and small web apps were built without comments in mind — and adding them after the fact tends to involve database migrations, server-side rendering changes, or signing up for a service that loads two megabytes of tracking JavaScript. None of that is necessary. A modern, privacy-first comment system can be added to any website with a single script tag, regardless of whether you run WordPress, Ghost, Webflow, a static-site generator, or hand-written HTML.

This guide walks through what to look for in a comment platform, the universal one-script-tag pattern that works across every CMS, and platform-specific instructions for the eight most common stacks. By the end you'll know exactly where to paste the snippet, how to configure moderation, and how to migrate any existing discussions you might have on Disqus, Hyvor Talk, or native WordPress comments.

What to look for in a comment system in 2026

The market has matured. The bar for a good commenting platform is no longer "does it load." The features that matter are:

  • Page-speed friendly. The widget should be under 30 KB gzipped and load asynchronously. Disqus is over two megabytes; that single decision will sink your Lighthouse score.
  • Privacy by default. No third-party tracking cookies, no behavioral retargeting pixels, GDPR & CCPA compliant out of the box. Your readers should not need a consent banner because of your comments.
  • Spam handled automatically. A modern ML classifier — not a keyword filter — that learns from real comment data. Without one, the moderation queue becomes a part-time job within a month.
  • Threaded conversations. Flat comment lists hit a wall around fifty replies. Nested replies keep discussions readable.
  • Data ownership. Disqus XML import on the way in, CSV/JSON export on the way out. If a vendor won't give you back your data, you don't own it.
  • Moderation that works on a phone. Bulk approve, bulk reject, regex rules, banned words — the dashboard should be usable from a coffee shop.

If a platform is missing any of those, you're going to migrate within the year. Pick once, well.

The universal pattern: one script tag

Every modern comment platform uses the same embed pattern: a single <script> tag pointed at a CDN-served widget bundle, plus a <div> placeholder where the thread renders. The pattern looks like this:

<div id="echothread-thread"></div>
<script
  src="https://cdn.echothread.io/widget.js"
  data-site="your-site-shortname"
  data-thread-id="optional-stable-id"
  defer></script>

That's it. The data-site attribute identifies your account; data-thread-id (optional) ties the comment thread to a stable identifier so URLs that change — trailing slashes, query strings, www/non-www variants — don't fragment the discussion across multiple threads. See the widget installation docs for the full attribute reference.

Where you paste this snippet depends on your platform. The next eight sections walk through the most common cases.

WordPress

The simplest path on WordPress is to disable native comments site-wide and drop the embed snippet into your active theme's comments.php. From the WordPress admin, go to Settings → Discussion and uncheck "Allow people to submit comments on new posts." Then in Appearance → Theme File Editor, replace the contents of comments.php with the embed snippet above.

If your existing posts already have comments you want to keep, export them via Tools → Export first, then import the WXR file into EchoThread's importer. Your old threads light up automatically against their original page URLs. The full WordPress migration guide covers edge cases like multisite installs.

Ghost

Ghost has no native commenting system at all (it was deliberately dropped to keep the runtime lean), so adding a third-party widget is the only path. In Ghost Admin, go to Code injection, and paste the embed snippet into the Site Footer textarea. The widget will appear on every post automatically.

If you want comments on some posts but not others, wrap the snippet in a check against the page handle: <script>if (location.pathname.startsWith('/posts/')) { /* embed here */ }</script>. Ghost themes don't expose a per-post toggle by default, so a path-based check is the cleanest workaround.

Webflow

Webflow's drag-and-drop builder hides most code, but every project has a Custom Code tab under Project Settings. Paste the embed snippet into Footer Code — not Header Code, because the widget assumes the DOM is parsed before it runs.

To control where the comment thread appears on a given page, drag an Embed element onto the canvas and paste a single <div id="echothread-thread"></div> into it. The footer script will populate that div automatically. Our Webflow walkthrough has screenshots.

Static-site generators (Astro, Eleventy, Hugo, Jekyll, Next, Nuxt)

Static-site generators are EchoThread's natural home: a single embed tag in your base layout template applies the widget to every page that needs it. The exact filename varies by tool:

  • Astro: src/layouts/Base.astro
  • Eleventy: _includes/base.njk or whichever layout your posts extend
  • Hugo: layouts/_default/baseof.html
  • Jekyll: _layouts/default.html
  • Next.js: app/layout.tsx or pages/_document.tsx — render the embed via next/script with strategy="afterInteractive"
  • Nuxt: app.vue or a layout under layouts/; use the useHead composable to attach the script

For app-router Next.js sites in particular, putting the embed in a Server Component layout works fine; you don't need a Client Component just to load a third-party widget.

Shopify

Shopify product pages don't have comments by default and the platform discourages them — reviews are usually a separate app. If you do want a discussion thread on blog articles, edit your theme's article.liquid template (under Online Store → Themes → Edit code) and paste the embed snippet at the bottom of the article block. Use Shopify's article handle as the data-thread-id so URL changes don't fragment threads: data-thread-id="{{ article.handle }}".

Squarespace and Wix

Both Squarespace and Wix support arbitrary HTML embeds via a "Code Block" or "Embed" widget. Drag the widget onto the page where you want the thread to appear and paste the embed snippet inside it. Site-wide installation requires a Squarespace Business plan or higher (the Code Injection feature) — below that, you'll need to add the embed per-page.

Hand-written HTML and custom apps

If you control the HTML directly, you have the most flexibility. The minimum is the script tag in <head> or just before </body>, plus a target div in your post template. For single-page apps that change routes without full page loads, call EchoThread.refresh() on every navigation event so the widget rebinds to the new thread. Both React Router's useEffect(navigate) hook and Vue Router's afterEach guard are good fits.

Migrating your existing discussions

If you've been using Disqus, Hyvor Talk, Commento, or native WordPress comments, your existing threads are valuable SEO and community assets — you don't have to lose them. EchoThread's importer accepts the standard XML export from each major platform and rebuilds the threads against your original page URLs in a single step. See the Disqus export migration guide for the exact steps; the same pattern applies to most platforms.

If your old comments contained bot spam or low-effort posts, the importer will run every imported comment through the same ML classifier your live site uses, so the migration also acts as a one-time spam cleanup.

Frequently asked questions

Does adding comments slow down my site?

It depends entirely on the platform. Disqus loads roughly two megabytes of JavaScript and dozens of third-party tracking pixels — that will hurt your Lighthouse score. A modern, privacy-first widget like EchoThread is under 15 KB gzipped, loads asynchronously after the main page renders, and has zero impact on Largest Contentful Paint. The lightweight commenting systems comparison goes deep on the page-speed numbers.

Do my readers need to create an account to comment?

EchoThread supports Google, GitHub, and email magic-link sign-in — no password to remember, no separate account to create. If a reader is already signed into Google or GitHub in the same browser, commenting takes one click.

Can I add comments without writing any code?

The single script tag described above is the bare minimum. If you're on Webflow, Squarespace, Wix, or Shopify, you can add it through the platform's UI (no editor or terminal required). If you're on WordPress, a one-time edit to comments.php is needed; everything else is point-and-click.

What about GDPR consent banners?

Modern privacy-first comment platforms set no third-party cookies and run no behavioral tracking, so they don't trigger a GDPR-era consent requirement on your site. EchoThread is GDPR and CCPA compliant out of the box; readers see the comment thread without a cookie banner getting in the way.

How much does a hosted comment system cost?

EchoThread's Hobby tier is free for blogs under 10,000 monthly page views, and Starter is $5 a month for sites up to 100,000 page views. Beta signups keep Hobby free for life on every site they had at the cutoff. Compared to running ads or paying a Disqus Plus subscription, a privacy-first hosted system pays for itself almost immediately in restored page-speed and recovered SEO.

Will my comments still work if I move my site to a different domain?

Yes. Comments are tied to a stable thread identifier (you can set this explicitly via the data-thread-id attribute) rather than the URL. Move from one domain to another, change your URL structure, switch from www to apex — existing threads follow.

Ready to add a privacy-first comment system to your site? Create a free EchoThread account and you'll have your first thread live in under five minutes.

Ready to try EchoThread?

Free during beta. Set up in under a minute.

Create free account