WordPress Block Patterns vs. Template Parts: Which One Should You Use?
When building or customizing a modern WordPress block theme, two features look confusingly similar at first glance: Block Patterns and Template Parts. Both group blocks together so you do not have to rebuild layouts from scratch, and both appear under Appearance > Editor. Yet putting a hero banner in parts/ or putting a global footer only in patterns/ creates awkward editing workflows down the line. Knowing the structural boundary between them keeps your theme clean.
Editorial illustration: use patterns/ for repeatable content sections and parts/ for global structural regions.
Summary
- Template Parts (
parts/*.html, registered intheme.jsonundertemplateParts) represent global structural regions—such as Header, Footer, and Sidebar—shared across multiple top-level templates (index.html,single.html,page.html). - Block Patterns (
patterns/*.php) are pre-designed block layouts (hero banners, pricing grids, callout boxes) that authors insert into posts, pages, or templates and customize per instance. - Per the WordPress Theme Handbook on Template Parts, template parts belong to specific template areas (
header,footer,uncategorized) and stay synced globally when edited in the Site Editor. - Per the WordPress Theme Handbook on Patterns Usage in Templates, patterns can use PHP for translatable strings and dynamic asset URLs, making them ideal inside HTML templates and template parts too.
Core difference: Structural region vs. reusable layout
The easiest rule of thumb is to ask who edits it and where it lives:
- Template Parts (
parts/*.html) are structural site chrome. When an admin updates a menu link or copyright year inside the Footer template part, that change should apply everywhere across the entire site immediately. - Block Patterns (
patterns/*.php) are starting-point layouts. When an editor inserts a “Two-Column Feature” pattern onto a landing page, they want to swap the headline and image on that page without changing every other landing page on the site.
If you are already deciding between synced and unsynced editor patterns created inside wp-admin, compare this with our guide on choosing synced vs. unsynced patterns in WordPress.
How Template Parts work in a block theme
As documented in WordPress Theme Structure and Template Parts, template parts live in your theme’s parts/ folder (for example, parts/header.html and parts/footer.html) and are declared in theme.json:
{
"version": 3,
"templateParts": [
{
"name": "header",
"title": "Header",
"area": "header"
},
{
"name": "footer",
"title": "Footer",
"area": "footer"
}
]
}
Inside a top-level template like templates/single.html, you reference the template part with a single block comment:
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main"} -->
<!-- wp:post-title /-->
<!-- wp:post-content /-->
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
Because header.html is a template part, WordPress renders the exact same global header across every template—and if a user customizes it in Appearance > Editor, WordPress saves that override once in the wp_template_part post type.
How Block Patterns work (including inside templates)
Block patterns live in patterns/*.php with a PHP file header and block markup:
<?php
/**
* Title: Callout Banner
* Slug: mytheme/callout-banner
* Categories: call-to-action
*/
?>
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:heading --><h2><?php esc_html_e( 'Need help with your site?', 'mytheme' ); ?></h2><!-- /wp:heading -->
</div>
<!-- /wp:group -->
As WordPress’s Patterns in Templates guide explains, using a .php pattern inside an .html template or template part (<!-- wp:pattern {"slug":"mytheme/callout-banner"} /-->) solves a major limitation of pure .html files: you get esc_html_e() translation support and get_theme_file_uri() for local theme images!
Decision checklist: Pattern or Template Part?
- Header, Footer, Post Meta bar, or Global Sidebar → Template Part (
parts/), referenced across templates. - Hero section, Testimonial row, Pricing table, or FAQ layout → Block Pattern (
patterns/), inserted into pages or posts. - Translatable strings or dynamic theme image URLs inside
header.html→ Put the markup in a Pattern (patterns/header-default.php) and embed that pattern insideparts/header.html. - Global colors, spacing, and typography tokens → Put those in
theme.json, not hardcoded inside individual patterns (see our WordPresstheme.jsonglobal styles guide).
Common mistakes
- Creating 15 Template Parts for one-off landing page sections. Template parts clutter Appearance > Editor > Patterns > Template Parts and imply global syncing when editors actually want per-page flexibility.
- Hardcoding site-wide headers directly inside
templates/index.html,single.html, andarchive.htmlwithout a Template Part. Duplicating header markup across six templates means editing six files every time a navigation item changes. - Hardcoding local image URLs or untranslatable English text inside
.htmltemplates. Wrap those sections in a.phppattern and call<!-- wp:pattern {"slug":"..."} /-->so WordPress resolves URLs and translations cleanly. - Testing theme edits directly on production. Always test new
theme.jsonandparts/changes on staging with a verified restore plan—see WordPress backup restore rehearsal.
Why this matters
Separating structural Template Parts from flexible Block Patterns makes block themes predictable for both developers and non-technical editors. Editors get safe, repeatable sections to build pages, while site-wide headers and footers stay consistent in one place.
My Take
Keep your parts/ directory lean—usually just header, footer, and optionally sidebar or post-meta. Put everything else (heroes, cards, CTAs, and even the translatable inner markup of your header/footer) in patterns/*.php and wire your global design tokens through theme.json.
Conclusion
Use Template Parts (parts/*.html + theme.json) for global structural regions shared across templates, use Block Patterns (patterns/*.php) for reusable content layouts and PHP-powered translations/assets inside templates, and test template changes on staging before deploying.