In short. Define collections in routes.yaml with distinct filters, permalink patterns and index templates, then assign posts through their primary tags.
Definition: A Ghost collection groups posts into a paginated index and determines their individual URL patterns. Separate collections use filters in
routes.yamlto assign distinct sets of posts to different sections of a site.
As of 17 October 2026, Ghost documents the following routing and tag behaviour.
Key facts
- Ghost's routing documentation states that a post can belong to only one collection because the collection determines where its URL lives.
- Ghost's Tags guide explains that tags are added through Post settings and can be reordered there.
- Ghost's filtering reference defines NQL, the query language used to filter results by fields and combine conditions with AND or OR.
How do collection filters and URL patterns fit together?
A collection configuration separates its index address from its post URL pattern. In Ghost's documented blog and podcast example, the collections block contains these rules:
collections:
/blog/:
permalink: /blog/{slug}/
template: blog
filter: primary_tag:blog
/podcast/:
permalink: /podcast/{slug}/
template: podcast
filter: primary_tag:podcast
The /blog/ key is the paginated collection index. Its permalink puts individual posts at addresses such as /blog/my-story/. The podcast collection has an index at /podcast/ and post addresses such as /podcast/my-episode/.
The filter determines which posts belong to each collection. The template selects the Handlebars theme template used for the index: blog.hbs or podcast.hbs in this example. The documented default is index.hbs when no template is specified. YAML nesting uses two spaces, and dynamic routes require trailing slashes.
How are posts assigned to a collection?
The primary_tag filter matches the first tag in a post's tag list. Ghost's Tags guide explains that Post settings accepts existing or new tags and allows tags to be reordered. For the configuration above, placing blog first assigns a post to the blog collection; placing podcast first assigns it to the podcast collection. A primary tag of news matches neither filter in this example.
Ghost's routing documentation warns that overlapping collection filters can cause problems with post rendering and pagination. It gives the example of separate collections filtered by camera and news: a post carrying both tags creates an overlap. Filtering on primary_tag supplies a unique assignment property.
For more complex conditions, Ghost's NQL reference defines a field and value separated by a colon. The - operator negates a value, + combines conditions with AND, and , combines them with OR. Filters based on slugs can use unquoted literal values.
How is the configuration applied and checked?
Ghost's routing documentation locates the configuration at content/settings/routes.yaml. Uploading the file through Ghost Admin applies the routes immediately; directly editing the server file requires a Ghost restart.
The documented example provides concrete checks: the blog index contains posts whose primary tag is blog, and the podcast index contains posts whose primary tag is podcast. Each post's address follows its collection's permalink. The same documentation notes that changing a publication's URL structure may also require redirects for existing content through redirects.yaml.
Related terms
- How do I change collection URL patterns in Ghost?
- How do Ghost internal tags differ from the primary public tag?
- How do I upload a redirects.yaml file in Ghost?
FAQ
Can I show the same post in several filtered sections?
Yes. Ghost's routing documentation describes channels as filtered, paginated streams. A post can belong to multiple channels, and channel membership leaves its URL unchanged.
Does adding a tag create a routing collection?
Ghost's Tags guide describes automatically generated tag feeds such as /tag/news and /tag/podcast. A post with both tags appears in both feeds; the routing documentation classifies these tag groupings as taxonomies.
Can I keep the existing index template?
Yes. The routing documentation specifies index.hbs as the default template when template is omitted. Its default collection also explicitly uses template: index.
Sources
Check how a page reads to answer engines. Open the GEO score analyzer