Commentz
A comment section for any page, added with a single script tag. Visitors read the conversation and, once signed in, join it, with a small editor for bold, italics, lists and links.
What your visitors get
A real conversation
Comments appear in order under the page, and new ones show up live without a reload.
Safe sign-in
One Commentz account works on every site that uses it, and the password is never typed into your page.
Edit and delete
Commenters can fix a typo or remove their own comment whenever they like.
You moderate
A Remove button appears on other people's comments when you're signed in as the site's owner.
Set it up
Five short steps. You do steps 1 to 3 once for your whole site, whatever products you use.
Have an account and be signed in
Registering a site needs a Commentz account. If you don't have one yet, the registration page offers to create it and brings you back.
Register your site
On the registration page, add the domain your pages live on (for example
example.com). You get a public client id, which goes in your embed tag.Prove you own the domain
Put one line in
/.well-known/commentz.txton your site, or add a DNS record. The guide shows exactly what to write. Addresses likelocalhostneed no proof, so you can test first.Copy your embed tag
The Commentz setup page shows the finished tag for the client id you pick, and tells you which of your domains are ready.
Paste it where the comments should go
Put the tag in your page's HTML where you want the comment box. Reload, and it's there.
The embed tag
This is what you paste. The setup page fills in your own client id.
<script src="https://www.commentz.co.uk/commentz.js"
data-client-id="your-client-id"
async></script>Optional extras on the same tag:
data-page-id="post-42": a stable name for the discussion, so it survives the URL changing.data-url="https://example.com/article.php?id=5": use this address as the page's identity.data-mount="comments": the id of an element to draw the comments into, instead of right after the tag.
Make it match your site
Add your own CSS and the comment box on every page of your site uses it.
- Sign in and open the setup page. Under Your CSS, choose your client id.
- Write only what you want to change. Your CSS is added after the built-in CSS below, inside the comment box, so a rule of the same weight wins. You don't need to copy all of it.
- Save. It applies to the comment box on every page of that client id the next time a page loads. Empty the box and save to go back to the built-in look.
For example, to change the colour of the buttons:
.cz-submit,
.cz-signin-btn {
background: #7c3aed;
}
.cz-body a {
color: #7c3aed;
}What you can and can't do
- Your CSS reaches only the comment box. It cannot change the rest of your page, and your page's own CSS cannot reach into the comment box.
- Use the class names in the CSS below. They are the ones to rely on: we won't rename them casually, and anything not listed may change.
- Up to 20,000 characters. For safety it can't load other files or run code, so
url(...),@import,image-set(...), backslash escapes and<are refused, and the page says which one. Use colours, gradients, fonts already on the visitor's device, spacing and layout. - Anyone can read your CSS: it is delivered to every visitor's browser, like the rest of your page's styling.
The built-in CSS, as it stands
This is exactly what the comment box ships with today, read from the live file. Copy a rule, change it, and paste it into the box.
:host {
all: initial;
}
.cz {
font: 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
color: #1a1a1a;
background: rgba(255, 255, 255, .75);
width: 100%;
padding: 1rem;
}
.cz-list {
margin: 0 0 16px;
padding: 0;
list-style: none;
}
.cz-item {
padding: 10px 0;
border-bottom: 1px solid #e5e5e5;
}
.cz-author {
font-weight: 600;
margin-right: 6px;
}
.cz-time {
color: #888;
font-size: 12px;
}
.cz-edited {
color: #888;
font-size: 12px;
margin-left: 6px;
}
.cz-actions {
display: flex;
gap: 12px;
margin-top: 4px;
font-size: 12px;
}
.cz-item-error {
margin-top: 4px;
font-size: 13px;
color: #c0392b;
}
.cz-edit-buttons {
display: flex;
gap: 8px;
margin-top: 8px;
}
.cz-body {
margin-top: 4px;
word-wrap: break-word;
}
.cz-body a {
color: #2563eb;
}
.cz-empty,.cz-status {
color: #888;
padding: 8px 0;
}
.cz-toolbar {
display: flex;
gap: 4px;
margin-bottom: 6px;
}
.cz-toolbar button,.cz-edit-toolbar button {
border: 1px solid #ccc;
background: rgba(255, 255, 255, .75);
;
border-radius: 4px;
padding: 4px 8px;
cursor: pointer;
font-size: 13px;
}
.cz-toolbar button:hover,.cz-edit-toolbar button:hover {
background: #f2f2f2;
}
.cz-toolbar button,.cz-edit-toolbar button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 30px;
padding: 0;
}
.cz-edit-toolbar {
display: flex;
gap: 4px;
margin: 4px 0 6px;
}
.cz-edit-box {
border: 1px solid #ccc;
border-radius: 4px;
min-height: 70px;
padding: 8px;
outline: none;
background: rgba(255, 255, 255, .75);
}
.cz-edit-box:focus {
border-color: #2563eb;
}
.cz-editor {
border: 1px solid #ccc;
border-radius: 4px;
min-height: 70px;
padding: 8px;
outline: none;
background: rgba(255, 255, 255, .75);
}
.cz-editor:focus {
border-color: #2563eb;
}
.cz-counter {
margin-top: 4px;
font-size: 12px;
color: #888;
text-align: right;
}
.cz-counter.cz-counter-over {
color: #c0392b;
}
.cz-who {
margin-bottom: 8px;
}
.cz-linkbtn {
border: none;
background: none;
padding: 0;
font: inherit;
color: #2563eb;
cursor: pointer;
text-decoration: underline;
}
.cz-signin,.cz-confirm {
padding: 8px 0;
}
.cz-signin-btn {
margin-left: 8px;
padding: 6px 14px;
border: none;
border-radius: 4px;
background: #2563eb;
color: #fff;
font: inherit;
cursor: pointer;
}
.cz-signin-btn:disabled {
opacity: .5;
cursor: default;
}
.cz-signin-msg {
margin-top: 6px;
font-size: 13px;
color: #c0392b;
}
.cz-submit {
margin-top: 8px;
padding: 6px 14px;
border: none;
border-radius: 4px;
background: #2563eb;
color: #fff;
font: inherit;
cursor: pointer;
}
.cz-submit:disabled {
opacity: .5;
cursor: default;
}
.cz-error {
color: #c0392b;
margin-top: 6px;
font-size: 13px;
}
.cz-wait {
margin-top: 6px;
font-size: 13px;
color: #666;
}
.cz-form.cz-waiting .cz-editor,.cz-form.cz-waiting .cz-toolbar {
opacity: .55;
}
.cz-toolbar button:disabled {
cursor: default;
}
.cz-item.cz-new {
animation: cz-flash 3s ease-out;
}
@keyframes cz-flash {
from {
background: rgba(37,99,235,.16);
}
to {
background: transparent;
}
}
@media (prefers-reduced-motion:reduce) {
.cz-item.cz-new {
animation: none;
background: rgba(37,99,235,.08);
}
}Common questions
Which comments appear on which page?
?query or #fragment, so /post/1 and /post/2 have separate threads.What if I rename a page or move it?
data-page-id (for example post-42). The discussion then follows that id instead of the address, so changing the URL, moving to https or adding www doesn't lose it. Adding an id to a page that already has comments starts a new, empty thread.It says "This domain hasn't been verified yet".
Can people comment without an account?
How do I try it before it goes live?
localhost (with a port, such as localhost:8080, to match only that port) and the tag works from your own machine with no proof needed.Can visitors edit or delete what they posted?
New to all this?
The getting-started guide walks through the whole thing, including the domain proof, with the exact text to copy.
Open the guide