Content Counter
This plugin adds shortcodes that display content counts anywhere on your Publii site - posts, pages, tags, authors. It works during the rendering process, replacing shortcodes with actual numbers directly in your HTML without any client-side JavaScript. You get full control over what gets counted, how labels are formatted, and where the numbers appear on your pages.

How it works?
Drop a shortcode like [pcc=posts] into a post, a page, or directly into your theme’s Handlebars template. During rendering, the plugin scans your site’s content structure, counts the relevant items, and replaces every shortcode with the actual number. The output is clean, static HTML – ready before your visitors even load the page.
Add a label parameter to include the tag or author name alongside the count. The position of label in the shortcode controls the output order – place it before for headings like “Tutorials: 12”, or after for natural sentences like “12 Tutorials”. The result fits any context without extra markup or template logic.
Available shortcodes:
- Basic counts:
[pcc=posts],[pcc=pages],[pcc=total],[pcc=featured]– the building blocks for displaying your site’s content at a glance. - Tag counts:
[pcc=tag name=tutorials]or[pcc=tag id=5]– count posts in a specific tag using either its slug or ID. - Author counts:
[pcc=author name=olivia-reynolds]or[pcc=author id=3]– count posts by a specific author. - Label before:
[pcc=tag label name=tutorials]→ Tutorials: 5 – name first, with a configurable separator. Good for headings and labels. - Label after:
[pcc=tag name=tutorials label]→ 5 Tutorials – count first, no separator. Reads naturally in sentences.
Key features:
- Flexible Identification: Reference tags and authors by their URL slug or numeric ID – whichever fits your workflow. Slugs are readable; IDs are stable if you ever rename a tag.
- Configurable Label Separator: Pick from built-in presets (colon, dash, pipe, arrow, none) or define your own custom separator for label-before mode.
- SEO-Safe Output: The plugin processes
<head>and<body>independently. Meta tags, Open Graph descriptions, and JSON-LD schemas always receive plain numbers – no HTML wrappers leaking into your SEO tags or social media cards. - Optional HTML Wrapping: Enable
<span>wrapping with customizable CSS classes. Each shortcode type generates its own modifier (pcc-posts,pcc-tag,pcc-author,pcc-label) for precise styling control. - Hidden Content Control: Choose whether posts and pages with “hidden” status are included in the counts. Only published items are counted by default.
- Works Everywhere: Shortcodes work in the content editors, source code editor, and Handlebars templates. The plugin handles Publii’s editor encoding automatically.
- Zero Client-Side JavaScript: All counting happens during the build process. Pages load with final numbers already rendered – no API calls, no DOM manipulation, no scripts.
Why consider this plugin?
- Dynamic Numbers, Static Performance: Display accurate content counts without sacrificing the speed of a static site. Numbers update automatically every time you build.
- Content at a Glance: Show visitors how much you offer – by topic, by author, or across the entire site. It adds context and credibility without custom theme work.
- Natural Language Integration: The label position feature lets you embed counts into sentences that read like real copy, not data labels.
- No Theme Modifications Required: The plugin operates on the final HTML output, so it works with any Publii theme out of the box.
What you get
- Unlimited use - forever, on any number of domains
- Free to use for both personal and commercial projects
- Community support through the forum
Details
- Author:
- Publii Team
- Version:
- Updated:
- Mar, 16 2026
Requirements and compatibility
- Browser:
- Edge, Firefox, Chrome, Safari, Opera
- Requirements:
- Publii 0.46.x and up