WordPress glossary

Template

A layout that controls how a type of page on your site is displayed.

Every page on a WordPress site is displayed using a template. A theme includes templates for different kinds of pages, like a single post, a page, an archive of posts in a category, the search results and the 404 page. The template decides which elements are shown and where, so a blog post might get a header, the post content, comments and a footer, while the search results get a list of matching posts instead.

When someone visits a page on your site, WordPress looks for the most specific template the theme includes for that page, and works its way down to more general ones until it finds a match. This is called the template hierarchy. If you visit a category called “News”, for example, WordPress first looks for a template made for that exact category, then for one made for all categories, then for one made for all archives. If the theme has none of those, it falls back to the index template, which every theme has to include.

That means a theme can be built with just a single template and still display every page on the site, while a theme with more templates can give each type of page its own design.

Most modern WordPress themes are so-called block themes. In those, templates are built out of blocks, and you can edit them in the Site Editor under “Appearance” → “Editor” → “Templates”. Your changes are saved to the database rather than to the theme files, so you can always reset a template to the version included in the theme. Parts that are repeated across many templates, like the header and the footer, are usually stored separately as template parts, so you only need to change them in one place.

In classic themes, templates are PHP files in the theme folder, like single.php for posts and archive.php for archives. To change them, you need to edit the code, preferably in a child theme so your changes aren’t lost when the theme is updated.

Both kinds of themes can also include templates you select for individual pages or posts, like a full-width layout or a landing page without a header. Those are covered in the page template entry.

Published November 23, 2026

Related terms