Tags in Joomla
Tags look like the simplest feature in Joomla: you type a word, press Enter, and you are done. But behind that small input field sits one of the most powerful and most misunderstood parts of the system. Tags reach into the database, the router, the search engine, and even your custom extensions.
This article explains how Joomla tags really work. It covers the basics for website owners and editors, the practical setup for administrators, and the technical details for developers. You will learn how to create tags, how to tag any kind of content, how tagging is stored under the hood, and how to avoid the most common mistakes.
Categories say what your content is. Tags say what it is about.
The goal is simple: help you understand Joomla tags well enough to use them with confidence.
1. The Basics
1.1 What is a Tag?
A tag is a flexible label you attach to a piece of content. Where a category is a fixed folder an item lives in, a tag is a topic an item is about. One article can carry many tags at once.
Tags serve two groups of people:
- They help editors connect related content across the whole site.
- They help visitors discover more on a topic, regardless of which category it sits in.
1.2 Tags Are Cross-cutting
A category answers the question "where does this belong?". A tag answers "what themes does this touch?". An article about a Joomla security release can live in the single category News, yet still carry the tags security, joomla-6, and updates. Those same tags can appear on a contact, a newsfeed, or a custom item too.
1.3 Tags Work Across Components
Tags are not limited to articles. Most core components support tagging out of the box:
- Articles:
com_content - Contacts:
com_contact - Newsfeeds:
com_newsfeeds - Categories themselves can be tagged.
Many third-party extensions reuse the same tagging system. Once you understand tags, you understand how a large slice of Joomla links content together.
1.4 Where Do I Find Tags?
In the Joomla 6 backend you manage all tags in one central place:
Components → Tags (manage every tag)
Components → Tags → New (create a tag)
You apply tags somewhere else entirely: on the edit screen of the item itself, in a Tags field. We will cover both screens below.
Back to top2. Creating and Managing Tags
2.1 Creating a Tag
To create a tag on its own, go to:
Components → Tags → New
Two fields matter most:
- Title: the human-readable label shown on the site and in lists.
- Alias: the short, URL-safe name. Joomla generates it from the title if you leave it empty.
2.2 Creating Tags On the Fly
You rarely need the New screen. When you edit an article, the Tags field lets you type a new word and press Enter. Joomla creates the tag immediately and links it to the item. This is fast, but it is also where most messy tag lists begin (see Common Mistakes).
2.3 The Tag Edit Screen
The edit screen is split into tabs, much like a category:
| Tab | What it controls |
|---|---|
| New Tag | Title, alias, parent, status, access, language, description. |
| Images and URLs | An icon image, a full-size image, and external links for the tag page. |
| Publishing | Created and modified dates, author, meta information. |
| Options and Metadata | Display options for the tag page and SEO metadata. |
2.4 Key Fields Explained
- Parent: leave at the default root for a flat tag, or pick another tag to nest inside.
- Status: Published, Unpublished, Archived, or Trashed. Only published tags appear on the site.
- Access: Public, Registered, Special, or a custom level. A tag the visitor cannot access is hidden from them.
- Language: bind the tag to one site language, or leave it as "All".
- Description: shown at the top of the tag page on the frontend.
3. Nested Tags
3.1 Tags Can Form a Tree
Most sites use a flat list of tags, but Joomla also lets you nest tags inside other tags. The result is a tree, exactly like categories:
ROOT
├── joomla
│ ├── extensions
│ └── templates
└── linux
Behind the scenes Joomla stores this tree with the same Nested Set Model it uses for categories. Every tag has an lft (left) and an rgt (right) value, plus a level and a path.
3.2 How lft and rgt Work
The rule is the same as for categories: a parent always wraps its children. The parent's lft is smaller than every child's lft, and its rgt is larger than every child's rgt. This lets Joomla fetch a whole branch of tags with a single fast query, without recursion.
3.3 The Rebuild Button
The Tags screen has a Rebuild button in the toolbar. It recalculates lft, rgt, level, and path. Use it after a migration, after direct database edits, or when the tag ordering looks wrong.
3.4 Should You Nest Tags?
In practice, keep tags flat. Nesting tags is rarely worth the extra complexity, because tags are meant to be cross-cutting and lightweight. If you find yourself building a deep tag tree, that structure usually belongs in your categories instead.
Back to top4. Tagging Your Content
4.1 The Tags Field
You tag an item from the item's own edit screen. For an article, open it and find the Tags field on the right-hand column:
Content → Articles → (open an article) → Tags
Start typing. Joomla suggests existing tags as you type. Pick one, or type a new word and press Enter to create and attach it in one step. You can add as many tags as you like to a single item.
4.2 The Same Field Everywhere
The Tags field looks and behaves the same on articles, contacts, newsfeeds, and categories. Any extension that opts in to tagging shows the identical control. This consistency is one of the quiet strengths of the system.
4.3 Batch Tagging
In the Articles list you can tag many items at once. Select several articles, open the Batch tool at the bottom of the list, choose a tag, and apply. This is the fastest way to add a topic tag to existing content without editing each item.
4.4 What Happens When You Save
When you save a tagged item, Joomla does not store the tags inside the article row. Instead it writes one row per tag into a separate mapping table that links the item to each tag. We look at that table in the developer section.
Back to top5. Tags on the Frontend
5.1 Menu Item Types
Joomla ships three menu item types for tags. Create them under Menus → (your menu) → New and pick the Tags group:
| Menu Item Type | What it shows |
|---|---|
| Tagged Items | All items that carry one or more chosen tags, with full layout options. |
| Compact List of Tagged Items | A simple, compact list of items for the chosen tags. |
| List All Tags | A page listing every published tag, so visitors can browse topics. |
The "Tagged Items" type can combine several tags. You can choose whether an item must match all selected tags or any of them.
5.2 The Two Tag Modules
Two core modules surface tags in your template positions:
| Module | Purpose |
|---|---|
Popular Tags (mod_tags_popular) |
Shows the most-used tags, optionally as a tag cloud sized by use. |
Similar Tags (mod_tags_similar) |
On a single item page, shows other items that share the same tags. |
Similar Tags is the easy way to add a "Related content" block. It needs no manual linking: it simply finds items that share tags with the page the visitor is on.
5.3 URLs and Routing
With SEF URLs enabled, a tag page gets a clean URL. The cleanest result comes from a menu item that points at the tag:
/topics/joomla → menu item "Tagged Items" for the joomla tag
/component/tags/tag/5-joomla → the same tag without a dedicated menu item
Without a menu item, Joomla falls back to the generic /component/tags/ route, which is functional but less tidy. For tags you want to rank, give them a real menu item.
6. Tags versus Categories
Tags and categories look similar in the backend but solve different problems. Choosing the wrong one is the single most common tagging mistake.
| Use a Category when… | Use a Tag when… |
|---|---|
| An item belongs in one place. | An item relates to many topics. |
| Hierarchy and structure matter. | You want flat, cross-cutting labels. |
| You need ACL or a workflow. | You want discovery and filtering. |
| The URL should reflect the structure. | The URL is secondary. |
A short way to remember the difference:
Categories define what content is.
Tags describe what content is about.
Most content needs exactly one category and a small handful of tags. If you reach for many categories per item, you probably wanted tags. If you create a brand new tag for almost every article, you probably wanted a category.
Back to top7. Real-world Tag Examples
The right set of tags depends on the type of website. The aim is always the same: a small, reusable vocabulary that describes what content is about, sitting next to a clean category structure. Here are four common patterns.
7.1 Knowledge Base or Support Site
Articles live in product categories, while tags describe the kind of help they offer:
installation
configuration
security
performance
troubleshooting
A visitor reading an install guide can then jump straight to every other "installation" article, even across different products.
7.2 Product Documentation
Categories follow the product modules; tags mark the reader level and topic:
beginner
advanced
api
migration
This lets you build a "Tagged Items" page for everything tagged api, regardless of which manual section it sits in.
7.3 News or Community Site
Categories split the sections (News, Blog, Events); tags carry the running themes:
joomla-6
extensions
security
accessibility
The Similar Tags module then turns every article into a small hub of related stories automatically.
7.4 Corporate Website or Webshop
On a corporate site, tags describe communication themes; on a shop, they cut across product categories:
| Site type | Example tags |
|---|---|
| Corporate | press, events, sustainability, careers |
| Webshop | sale, new-arrival, bestseller, clearance |
The key idea is the same in every case: the category tree mirrors the site structure, and a short list of tags mirrors the themes that cut across it. Keep the tag list small enough to remember without looking it up.
Back to top8. Under the Hood (Developer View)
8.1 Two Core Tables
Tagging uses two tables. The first stores the tags themselves:
#__tags
id, parent_id, lft, rgt, level, path
title, alias, note, description
published, access, language
params, metadesc, metakey, metadata
images, urls, hits, version
publish_up, publish_down
You will notice it is almost identical to #__categories: same nested set columns, same publishing and metadata fields. Tags are, in effect, a second taxonomy tree.
8.2 The Mapping Table
The link between an item and its tags lives in a separate table:
#__contentitem_tag_map
type_alias e.g. com_content.article
core_content_id PK from #__ucm_content
content_item_id PK from the real content table (e.g. #__content)
tag_id PK from #__tags
tag_date when the link was saved
type_id PK from #__content_types
Each tagged item produces one row per tag. This is a classic many-to-many design: one item links to many tags, and one tag links to many items.
8.3 Querying Tags with SQL
Once you know the two tables, direct queries are short. List every published tag:
SELECT id, title
FROM #__tags
WHERE published = 1
ORDER BY title;
Find the tags attached to one article (id 101) by joining the map to the tags table:
SELECT t.id, t.title
FROM #__tags AS t
INNER JOIN #__contentitem_tag_map AS m
ON m.tag_id = t.id
WHERE m.type_alias = 'com_content.article'
AND m.content_item_id = 101;
Count how many items carry each tag, most-used first:
SELECT m.tag_id, COUNT(*) AS total
FROM #__contentitem_tag_map AS m
GROUP BY m.tag_id
ORDER BY total DESC;
Always filter on type_alias as well as content_item_id. The id 101 is only unique within a content type, so an article and a contact can share the same numeric id.
8.4 The UCM Layer
Tags rely on Joomla's Unified Content Model (UCM). This is the abstraction that lets one tagging system work for articles, contacts, and custom items alike. Three tables support it:
| Table | Role |
|---|---|
#__content_types |
Defines each taggable type and how to read its real table. |
#__ucm_content |
A normalised copy of core fields (title, alias, state) for any tagged item. |
#__ucm_base |
A lookup of UCM ids back to their content type and item. |
This is why the map table has both a core_content_id (UCM) and a content_item_id (the real row). UCM gives Joomla a single, consistent way to talk about "an item" no matter which component owns it.
8.5 The Tags API in PHP
You rarely touch the tables directly. The TagsHelper class does the work:
use Joomla\CMS\Helper\TagsHelper;
$tagsHelper = new TagsHelper();
// All tag ids on a given article:
$tagIds = $tagsHelper->getTagIds(42, 'com_content.article');
// Full tag objects (title, alias, etc.) for an item:
$itemTags = $tagsHelper->getItemTags('com_content.article', 42);
// All items that carry a set of tags:
$items = $tagsHelper->getTagItemsQuery([5, 9]);
8.6 Making a Custom Component Taggable
To add tagging to your own component, you do not rebuild anything. You opt in:
- Register your type in
#__content_types(alias, table mapping, route helper). - Have your Table class implement
TaggableTableInterfaceand useTaggableTableTrait. - Add a
tagsfield oftype="tag"to your edit form.
The trait wires in an observer that writes the map rows automatically whenever you store or delete an item. Your component then gets the Tags field, frontend tag pages, and the modules for free.
8.7 Events and Observers
Tagging happens through a table observer rather than a single dedicated event. When a taggable item is saved, the observer fires alongside the normal content events. Plugins can react with the standard content events using a tag context:
| Event | When it fires |
|---|---|
onContentAfterSave (context com_tags.tag) |
After a tag itself is saved. |
onContentBeforeDelete (context com_tags.tag) |
Before a tag is deleted. |
| Table observer on a taggable item | Writes or removes #__contentitem_tag_map rows on store and delete. |
9. Web Services API
9.1 Tags Travel With Their Items
Joomla 6 does not ship a standalone public REST endpoint that lists every tag. Instead, tags appear inside the responses for content that supports them. When you read an article through the API, its tags come along in the relationships:
curl -H "X-Joomla-Token: <token>" \
https://example.test/api/index.php/v1/content/articles/42
The JSON response includes a tags relationship listing the tag ids attached to that article.
9.2 Assigning Tags Through the API
To tag an item programmatically, send the tag ids when you create or update it. For an article:
curl -X PATCH \
-H "X-Joomla-Token: <token>" \
-H "Content-Type: application/json" \
-d '{"tags": ["5", "9"]}' \
https://example.test/api/index.php/v1/content/articles/42
Joomla updates the mapping table to match exactly the ids you send. An empty array removes all tags from the item.
9.3 When You Need a Tag Endpoint
If your project genuinely needs to list or manage tags over REST, you expose them through a small custom web services plugin or a component API controller. Because the data already lives in #__tags and TagsHelper handles the queries, such an endpoint is thin to write.
10. SEO and Metadata
10.1 Tag Pages Are Real Pages
Every published tag has its own frontend page that lists the items carrying it. Search engines can index these pages, which makes tags a real SEO asset, or a real SEO liability if you neglect them.
10.2 Give Important Tags Metadata
On the tag's Options and Metadata tab you can set a meta description and a page heading. A tag page with a clear title and description, plus a written description at the top, can rank as a topic hub. An empty tag page with just a list of links rarely does.
10.3 Avoid Thin and Duplicate Tag Pages
Hundreds of tags that each point to one or two items create many thin pages. These can dilute your site in search results. Keep the number of tags small and make sure each tag groups a meaningful amount of content.
10.4 Control Indexing
If you do not want tag pages indexed, set the metadata robots value to noindex, follow on the tag, or handle it globally in your template. This keeps the discovery benefit for visitors while keeping thin pages out of the index.
11. Common Mistakes and Pitfalls
11.1 Tag Sprawl
Symptom: hundreds of tags, many used only once, with near-duplicates like seo, SEO, and search-engine-optimization.
Fix: agree on a short, fixed tag vocabulary before you start. Treat the on-the-fly tag field as a convenience, not a free-for-all. Merge duplicates by re-tagging items to the surviving tag and deleting the rest.
11.2 Using Tags Instead of Categories
Symptom: every article has ten tags and sits in a single generic category. Navigation and URLs feel flat.
Fix: move structural divisions into categories, and keep tags for genuine cross-cutting themes. One clear category plus a few tags beats no category and a cloud of tags.
11.3 Forgetting the Menu Item
Symptom: tag pages work but use ugly /component/tags/ URLs and rank poorly.
Fix: create a "Tagged Items" menu item for each tag you care about, so it gets a clean, stable URL and proper page metadata.
11.4 Case and Spelling Drift
Symptom: visitors land on a tag page that lists fewer items than expected because content was split across two spellings.
Fix: keep tags lowercase and consistent. Decide on singular or plural (for example tutorial, not a mix of tutorial and tutorials) and stick to it.
11.5 Ignoring Access on Tags
Symptom: a tag page shows links to items the visitor cannot actually open.
Fix: remember that tag and item access are separate. Set the tag access to match the audience, and rely on the item access for the final check.
Back to top12. Best Practices
If you only remember a few things from this article, remember these:
- Use categories for structure and tags for topics. They are not interchangeable.
- Define a small, fixed tag vocabulary up front, and reuse it.
- Keep tags flat, lowercase, and consistently spelled.
- Give important tags a real menu item, a description, and metadata.
- Use the Similar Tags module for instant "related content" with no manual linking.
- Prune one-off tags so you do not create thin, low-value pages.
- In custom extensions, opt in with
TaggableTableInterfacerather than reinventing tagging.
13. Quick Reference
CREATE TAG Components → Tags → New
TAG AN ITEM Open the item → Tags field → type & Enter
BATCH TAG Articles list → select → Batch → choose tag
NEST Set the "Parent" field (use sparingly)
REBUILD Components → Tags → Rebuild (after migration/DB edits)
FRONT PAGE Menu item type "Tagged Items"
ALL TAGS Menu item type "List All Tags"
RELATED Module: Similar Tags (mod_tags_similar)
CLOUD Module: Popular Tags (mod_tags_popular)
TABLES #__tags + #__contentitem_tag_map (+ UCM)
SQL JOIN map.tag_id = tags.id, filter on type_alias
API (PHP) TagsHelper->getItemTags('com_content.article', $id)
API (REST) tags arrive inside /v1/content/articles responses
SEO Add metadata + a clean menu URL to key tags
Back to top14. Summary
Tags are far more than a text box. They are a second taxonomy that links content across the whole site:
- Discovery: visitors follow topics across categories.
- Relationships: the Similar Tags module builds related-content blocks automatically.
- Flexibility: one item can carry many topics at once.
- Reach: the same system works for articles, contacts, newsfeeds, and custom extensions.
- SEO: well-managed tag pages become topic hubs; neglected ones become thin pages.
- Developer integration: a shared API and a simple opt-in interface.
Used with discipline, tags make a Joomla site easier to explore and easier to grow. Used carelessly, they create sprawl, thin pages, and confusion. The difference is almost always a small, consistent vocabulary and a few clear menu items.
If you are planning a new Joomla site, cleaning up a tag list that has grown out of control, or adding tagging to a custom extension, it pays to get the taxonomy right early. Tags are the quiet web of connections that ties your content together.
Back to top

Joomla en Linux specialist voor snelle, veilige en schaalbare websites.


