Docs: Comments
Comments
Comments on your posts and pages, kept on your own site: who may comment, spam control and one moderation queue.
The Comments module lets visitors discuss your posts and pages on your own site. Comments are stored in your own database, with no third party, no tracking and no outside script. It arrived in 1.17.0, is free, and is off until you enable it.
Turning it on #
- Enable Comments under System ▸ Modules.
- Blog posts take comments straight away; switch them off or close them in a post's editor. A page takes comments when its Layout allows them. Since 1.19.0 you can also switch comments off for one page in the page editor: its thread and count are then hidden, not deleted, and come back if you switch them on again.
- Choose who may comment, and what waits for a moderator, on the Settings tab of the Comments page. The tab also closes comments on posts after a number of days, rejects more than a set number of links, keeps a list of blocked words, asks guests for a captcha, mails staff when a comment waits (at most one mail an hour) and deletes spam after 30 days (or 7, or never). Since 1.21.0 it also holds the switch for pictures in comments (see Forums), and a role can have its new comments held for review (see Members and roles).
Who may comment #
Members can comment while comments are open, within their role's limits. Since 1.19.2 a role can have a daily and an hourly limit on comments, and can be stopped from posting links to other sites (People ▸ Roles). Since 1.20.0 the wait between comments and the longest comment are role settings too. A comment over a limit, or with a link it is not allowed, is refused with a reason. Guests can too if you allow it: they give a name and, if you ask for one, an email address, which is never shown publicly. A guest's form carries no session, so pages with comments stay cacheable.
Spam and moderation #
- A spam gate catches bots with checks a person never notices, and reCAPTCHA if you have set it up. A suspicious comment is held for a moderator rather than refused, so a real person is never turned away by a mistake.
- Hold rules decide what waits: a commenter's first comment, comments with links or words you list, or every comment.
- One moderation queue with tabs for Waiting, Approved and Spam, and, since 1.21.0, a Hidden by a ban tab and a Deleted (n) link in place of the old Bin tab. Approve, mark as spam, hide, reply or edit, one at a time or in bulk. Hide moves a comment to the site's recycle bin, and the Deleted link opens the bin on comments. Restore brings it back from the bin, with the status it had, or from Spam. Moderating needs the Moderate comments permission; the settings need Manage comment settings.
- Reports. Since 1.20.0 members can report a comment, at the end of its row, and reports wait on the panel's Reports page. See Members and roles.
- Delete forever needs its own permission since 1.18.0, Delete comments permanently. Administrators have it after the update; give it to other roles as you see fit. A comment in the recycle bin is deleted for good from there, and by itself when the keep period ends.
- Held comments. Since 1.21.0 a role can have its new comments held for review (all of them, only while the member is new, or only those with links). It starts off. Administrators are never held, and nobody is notified of a held comment. Approve shows it as new; Reject is an ordinary delete that can be restored.
- Bans. Since 1.21.0 a ban can hide the member's comments while it lasts; they come back when it ends or is lifted. A comment hidden this way is not in the recycle bin and is never deleted by it. They are listed on the Hidden by a ban tab.
Members editing their own comments #
Since 1.18.0 members can edit and delete their own comments for a while after posting. On the Settings tab you choose whether they may, and for how many minutes. An edit is checked again like a new comment, and a deleted comment leaves the page and waits in the recycle bin for moderators, with its replies kept.
Pictures in comments #
Since 1.21.0 members can attach pictures to comments, and to forum posts. The switch in Comments is off until you turn it on. Roles have May add pictures, Pictures per post (4, from 1 to 20) and Pictures per day (30; 0 means no limit), and the daily count is shared with forum posts and direct messages. A member needs a confirmed email address. Pictures are stored as WebP in protected files, never in a public folder, and GIF and animated WebP are refused. Switching the feature off stops new pictures only. A theme that draws its own comments reads the theme guide.
Restrictions and community rules #
Since 1.21.0 a member under a comment restriction sees a dated notice in place of the comment form, and a member who has not yet accepted the community rules is asked to accept them once, on the form, when "Accept before the first post" is on. Restrictions are set from People ▸ Users, and the rules under Community ▸ Rules and Member settings; see Members and roles.
Replies and members' own data #
Members can ask to be emailed when someone replies to them. Under Your comments (/comments/mine) a member sees what they wrote and its status, and can download all of it. When an account is deleted, its comments stay, shown as "Former member", with nothing left that points to the person. A guest's comments can be erased by their address from the queue. When a post or page is deleted for good, its comments go with it.
Coming from Forums #
Before 1.17.0, Blog comments lived in the Forums module. When you update, every existing comment is copied into Comments with its date, author and replies. The forum topics stay where they were, as a backup. Update Forums to 1.17.0 with Tilspire: the copy waits until it is. Since 1.17.2 the copy finishes on its own, from visits to the site, with no cron line. Since 1.19.0 the Forums no longer keep comment threads of their own, and the option to give comments back to the Forums is gone. A site still using the old threads is moved at the update. If Comments is off then, nothing moves, and Comments does it once you switch it on. The old forum topics stay as an archive: readable while Comments is off, hidden from the forum while it is on, and taking no replies either way. A move that failed can be run again from the Comments settings.
Through the Operator API #
Since 1.18.0 the Operator API can propose comment moderation, replies and settings changes. Each waits in the Review queue for a person; a deletion can be proposed but never approved by the API itself. Since 1.21.0 it can also propose a decision on a reported comment (keep, remove or dismiss), which a person approves.
For theme authors #
A theme shows a post's or page's comments through the Template API, and Tilspire fills in a working comments block for a theme that doesn't draw its own. Since 1.18.0 a comment's buttons come from actions('comments.comment', $comment), so the theme never decides who may reply, edit or delete. Since 1.20.0 a comment's Report is drawn as the last item of that row, no longer in a menu at the comment's top right, and a role can wear a staff badge, which both themes draw beside the author's name. See the Template API.