Display Comment Counts

The {{ meerkat:count }} Antlers tag can be used to display the total number of comments for the current page. By default, the count tag will not consider comments that have not been approved, are marked as spam, or have been soft-deleted.

The following would display the total number of comments on the page:

1<p>There are {{ meerkat:count }} comments!</p>

#Customizing Filters

The comments that are counted by the count tag can be customized by supplying a value to the filter parameter:

1<p>There are {{ meerkat:count filter="is:spam(true)" }} spam comments.</p>

Alternatively, we could limit the displayed count to only those comments left by the currently authenticated Statamic user:

1<p>You have left {{ meerkat:count filter="user:in(*current*)" }} comments on this post.</p>

You may apply any filter from the Basic Filtering guide, or craft more advanced counts by utilizing the techniques from the Advanced Filtering guide.

#Formatting Results

You may specify a custom number format by supplying the number_format parameter. This parameter works in exactly the same way as Statamic's format number modifier:

2<p>You have {{ meerkat:count format_number="1|,|," }} comment(s).</p>

Some absolutely amazing

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.