%%category%% inserts the post’s category name into a title or description template.
Example
Template: %%title%% %%sep%% %%category%% %%sep%% %%sitename%%
A post “Stop Brute-Force Logins” in the “WordPress Security” category becomes: Stop Brute-Force Logins | WordPress Security | Aegisify.
When it helps
- Large blogs where the category adds useful context in search results.
- News or magazine sites with clear sections.
When to avoid it
- Short title space: titles over about 60 characters get cut off, and the category often pushes the site name out of view.
- Posts in “Uncategorized”: the word appears in titles. Assign real categories first.
- Pages: pages do not have categories, so the variable is empty there.
Multiple categories
If a post is in several categories, keep your category structure clean so the category shown is the most meaningful one. Avoid assigning many categories to the same post.
Archives use %%term%%
On category archive pages, use %%term%% instead; it represents the archive being viewed.
Testing
After changing a template, view the source of a few posts to confirm the titles read well.
Related: Template variables engine, Post title template.
