Synced Patterns vs Template Parts: Which to Use

Synced Patterns vs Template Parts: Which to Use

Synced patterns vs template parts is a decision about one thing: whether you are reusing content or reusing structure. A synced pattern is content — one copy stored in the database, edited from the Patterns screen, pulled into as many posts as you like. A template part is structure — a region of a block theme’s layout that lives in the theme’s /parts folder and gets included by templates, not by posts.

Most of the confusion comes from a third thing that shares the same screen and the same inserter: the ordinary unsynced pattern, which copies its blocks into your post and then forgets where they came from. Those three cover almost every reuse case in a block theme. Picking the wrong one costs nothing on page one and a long afternoon on page fifty.

Work out which one you already have

Open the post in the editor and switch to the Code editor (Ctrl/Cmd + Shift + Alt + M). A single line like <!-- wp:block {"ref":412} /--> is a synced pattern. A wall of ordinary block markup is an unsynced pattern that was copied in. <!-- wp:template-part ... /--> only appears in templates, never in a post, so if you are looking for your header here you are in the wrong editor.

What each one actually is

All three arrive through the same Patterns screen in WordPress 7.1, which is exactly why they get muddled. Under the hood they are three different storage mechanisms with three different failure modes.

Unsynced patterns: a copy, and then you are on your own

Insert an unsynced pattern and the editor writes its blocks straight into post_content. There is no link back. Edit the pattern afterwards and the fifty pages already using it do not change, because they never pointed at it — they got a photocopy.

That is a feature, not a shortcoming. A hero section where every page needs a different headline and image wants exactly this behaviour. Unsynced patterns can come from your theme, from a plugin, from the Pattern Directory, or from blocks you select and save yourself.

Synced patterns: one copy, referenced everywhere

A synced pattern is stored as a post of type wp_block. That post type has been in core since WordPress 5.0, when the same feature was called a reusable block — the changeset that added it describes wp_block as “the reusable block post type”. WordPress 6.3 renamed reusable blocks to synced patterns and folded them into the unified Patterns screen; nothing about the storage changed, which is why a site that has been running since 2019 still has its old reusable blocks working.

The page that uses it stores only a reference:

<!-- wp:block {"ref":412} /-->

Because it is a post type, you can inventory synced patterns from the shell without any extra tooling:

# Every synced and unsynced user pattern on the site
wp post list --post_type=wp_block --post_status=publish \
  --fields=ID,post_title,post_name,post_modified

# Which posts use pattern 412
wp db query "SELECT ID, post_type, post_title FROM wp_posts
  WHERE post_content LIKE '%\"ref\":412%'" --skip-column-names

WP-CLI also has a dedicated wp block synced-pattern command with create, get, list, update and delete subcommands. Read the small print before you build a deployment script on it: the command reference states it is not yet in a stable WP-CLI release and requires the nightly build or the separate package. The wp post list approach above works on every install today.

Template parts: regions of the theme, not of the post

A template part is an .html file in the theme’s /parts folder containing block markup and nothing else. Nested folders are not supported, so every part sits directly in /parts. Templates do not pick them up automatically — a template has to include one explicitly, and the slug must match the filename without its extension:

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- Template content goes here. -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

Register them in theme.json so they show up properly labelled in the Site Editor rather than as bare slugs:

{
  "$schema": "https://schemas.wp.org/trunk/theme.json",
  "version": 3,
  "templateParts": [
    { "area": "header", "name": "header", "title": "Header" },
    { "area": "footer", "name": "footer", "title": "Footer" },
    { "area": "uncategorized", "name": "sidebar", "title": "Sidebar" }
  ]
}

Core ships three areas: header, footer, and uncategorized, which the admin labels General. You can register your own with the default_wp_template_part_areas filter, supplying an area slug, an area_tag from the allowed set (div, article, aside, footer, header, main, section), a label, a description and an icon. Note the icon limitation: only header, footer and sidebar are supported, and anything else falls back to a generic icon rather than erroring.

Edit a part in the Site Editor and WordPress does not touch your theme file. It writes a database record that shadows it, the same way global styles shadow theme.json — which is the behaviour behind most “my theme update did nothing” reports. Customizing a block theme with theme.json or a child theme works through that cascade in detail, because it catches people on template parts exactly as it does on styles.

The criteria I judged these on

Stated up front so you can disagree with the weighting rather than the conclusion. These are the five questions that have actually decided it on client sites.

When this changes, should every page change with it? The single most useful question, and the one people skip. A VAT number, an opening-hours line, a compliance footnote: yes. A testimonial, a hero headline, a product blurb: no. Answer this first and you have usually answered the whole thing.
Does it need to survive a theme switch? Template parts belong to the theme. Change themes and your carefully built header does not come with you, because the new theme has its own /parts folder and its own records. Synced patterns are posts, so they are theme-independent — they will still be there, possibly styled differently.
Does it need to be in Git? Theme files are reviewable, diffable and deployable. Database records move between environments only in a database dump. If a designer needs to review the footer before it ships, the footer belongs in a file.
Who edits it, and with which capability? The Site Editor needs edit_theme_options, which an Editor-role user does not have. An Editor can manage synced patterns. If the person who updates the promo banner is not an administrator, a template part is the wrong container no matter how tidy it looks.
Is it one region of the layout, or a thing that appears mid-content? Template parts are regions — header, footer, sidebar, a loop area. They are addressed by templates. Anything that appears partway down a post, at a place only the author knows, cannot be a template part at all.

Synced patterns vs template parts vs unsynced patterns, compared

On a narrow screen this table stacks into one card per option.

 Unsynced patternSynced patternTemplate part
What it is forA starting point you then customize per pageOne piece of content shown identically in many placesA region of the site’s layout
Where it livesTheme /patterns/*.php, a plugin, or a wp_block post marked unsyncedA wp_block post in the databaseTheme /parts/*.html, plus a wp_template_part record once edited
What the page storesA full copy of the blocks<!-- wp:block {"ref":412} /-->Nothing — the template stores wp:template-part
Edit it laterOnly that one page changesEvery use changes at once, immediatelyEvery template using it changes at once
Inserted intoPosts, pages, templates, other patternsPosts, pages, templatesTemplates only
Survives a theme switchCopies survive; theme-registered originals do notYesNo
In version controlYes, if registered in the themeNoYes, until someone edits it in the Site Editor
Minimum capability to editWhatever edits the postEditor role is enoughedit_theme_options — administrator in practice
If you delete itExisting pages unaffectedEvery page using it loses that contentTemplates fall back to the theme file, or render nothing
Per-instance content editsAlways — it is a copyOnly via pattern overrides, on four block typesNo
Storage locations per the WordPress Theme Handbook; wp_block per the core changeset that registered it. Capability behaviour is the default with no role plugin in play.

Read down the “If you delete it” row before you do anything else. It is the row that explains why a synced pattern feels so convenient for six months and then costs you a bad morning.

Same layout, different content? Use pattern overrides

There is a case neither option handles well on its own: twenty author bio cards that must stay visually identical while each holds a different name, photo and blurb. A synced pattern gives you one shared copy of everything including the text. An unsynced pattern lets the twenty cards drift apart in padding and colour over two years.

Pattern overrides, added in WordPress 6.6, are the answer. You mark specific blocks inside a synced pattern as overridable; the design stays shared, and each instance supplies its own content.

  1. Build the card, select the outer Group, and save it as a synced pattern.
  2. Open it with Edit original so you are editing the pattern itself, not an instance.
  3. Select a block, open the Advanced panel in the inspector, and click Enable overrides.
  4. Give it a name. That name is the key WordPress uses to map each instance’s content to that block, so make it descriptive — “Author name”, not “Heading 2”.
  5. Repeat for each editable block, then save. Named blocks show their names in List View.

Overrides are built on the Block Bindings API, so only blocks that support bindings can be overridden. As of WordPress 7.1 that is four block types: Heading, Paragraph, Image and Buttons. Attribute coverage is narrow too — Image exposes url, alt and title; Button exposes url, text, linkTarget and rel. If your card needs an overridable Columns block or a custom block, this is not yet your tool and there is no public opt-in to add one.

The API underneath reaches further than overrides do, and it is worth knowing about separately: it can pull a value from a custom field, a term, or a source you register yourself, and it covers two blocks — List Item and Post Date — that are not offered as overrides at all. The Block Bindings API and custom fields in core blocks covers that side of it, including how a bound block resolves inside a Query Loop.

In the pattern, an overridable paragraph carries a binding to the core/pattern-overrides source:

<!-- wp:paragraph {"metadata":{
  "name":"Author bio",
  "bindings":{"__default":{"source":"core/pattern-overrides"}}
}} -->
<p>Default bio text, shown until an instance overrides it.</p>
<!-- /wp:paragraph -->

The page using it then stores its own values on the reference block’s content attribute, keyed by the names you chose:

<!-- wp:block {"ref":412,"content":{
  "Author bio":{"content":"Writes about block themes and performance."}
}} /-->

Rename an override and you orphan the content

The mapping is by name, not by position or block ID. Rename “Author bio” to “Bio” in the pattern and every instance’s stored text is keyed to a name that no longer exists, so each one silently falls back to the pattern’s default. Nothing errors and nothing is lost from the database — it just stops being displayed, which is harder to notice. Settle your override names before you build the twentieth card.

Patterns in theme files beat patterns in the database

If you have file access, register patterns in the theme rather than saving them in the editor. A PHP file in /patterns with a header comment is all it takes, and you get a reviewable, deployable artefact instead of a database row nobody can diff:

<?php
/**
 * Title: Pricing callout
 * Slug: wpfairs/pricing-callout
 * Categories: call-to-action
 * Keywords: pricing, offer, cta
 * Block Types: core/post-content
 * Post Types: page
 * Viewport Width: 1280
 * Inserter: yes
 */
?>
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
  <!-- wp:heading -->
  <h2 class="wp-block-heading"><?php esc_html_e( 'Simple pricing', 'wpfairs' ); ?></h2>
  <!-- /wp:heading -->
</div>
<!-- /wp:group -->

Only Title, Slug and Categories matter for most patterns. The ones worth knowing about are the filters: Post Types restricts where it appears, Block Types associates it with a block so it is offered as a replacement for that block, Inserter: no hides it from the inserter entirely (useful for a pattern that exists only to be referenced from a template), and Template Types suggests it for specific templates such as home or single.

A template can then reference that pattern by slug instead of inlining it:

<!-- wp:pattern {"slug":"wpfairs/pricing-callout"} /-->

That gives you something close to the best of both: the markup lives in one file under version control, and every template referencing it picks up your next edit. It is how the default themes are built.

The Site Editor flattens that reference

Insert a theme pattern into a template through the Site Editor and the editor writes a full copy of its blocks into the template, tagging the wrapper with metadata.patternName rather than keeping a wp:pattern reference. The copy is then independent, so later fixes to the pattern file never reach it — and if you export the theme, the same section exists twice. This is a known gap, tracked in the Create Block Theme repository, with a proposal to rewrite unedited copies back into references on save. Until it lands, hand-write wp:pattern references in your template files and accept that editing that template in the Site Editor will inline them.

Worth checking the pattern files of a theme you trust before writing your own. Twenty Twenty-Five ships free with WordPress and is a good reference. The theme running this site organises its /patterns and /parts folders the same way — disclosure: I build and maintain Bloqra, the theme and block plugin used here — but nothing in this article is specific to it. Everything above is core behaviour, and a default theme is the better place to learn it because you can compare against the Handbook line by line.

Four ways this goes wrong

Someone deletes a synced pattern. Every page referencing it now points at a wp_block post that is in the trash, and those pages lose that section. The pattern is a post, so trashing is reversible — restore it from the Patterns screen and the references resolve again. Permanent deletion is not reversible, and the wp db query above is how you check the blast radius before clicking.
You switch themes and lose the header. Expected, not a bug. Template parts are the theme’s, and Site Editor edits to them are stored per theme. Before any theme change, open each part in the Site Editor, copy the markup out of the code view, and keep it in a text file. Then test the site the way you would after a major update rather than eyeballing the homepage.
A third-party block inside a synced pattern stops loading. Deactivate the plugin that provides it and the pattern breaks in one place, which sounds better than it is: that one place is every page using the pattern. The failure looks like a validation warning and gets misdiagnosed constantly — a block that contains unexpected or invalid content covers telling the two notices apart, and the key point for patterns is that you fix it in the pattern, not on the page.
You detach a synced pattern and want it back. Detaching replaces the reference with a copy of the blocks, which is a one-way action in the editor — there is no “re-sync”. Nothing is written until you press Update, so a reload is the cheap undo; if you have already saved, restoring an earlier revision of the post gets the reference back, assuming WP_POST_REVISIONS left you enough history.

What changed in WordPress 7.1

Two changes in 7.1 matter here, and one of them will bite anyone maintaining editor JavaScript.

You can turn off content-only editing for template parts. Template parts default to content-only editing, which locks the structure and lets editors change text. WordPress 7.1 adds a disableContentOnlyForTemplateParts editor setting to restore standard block editing, settable from PHP via the block_editor_settings_all filter or from JavaScript:

wp.data.dispatch( 'core/block-editor' ).updateSettings( {
	disableContentOnlyForTemplateParts: true,
} );

One caveat from the release notes: in template-locked rendering mode, content-only editing for template parts stays disabled regardless of the setting. For a one-off change there is now a command-palette entry — “Enable/Disable content-only editing for patterns and template parts” — which covers patterns too and lasts for the session only. That is the right tool when a client reports they “can’t move anything” in the footer; you do not need a filter for a five-minute fix.

The @wordpress/reusable-blocks package is now a no-op. Its public APIs log deprecation warnings starting in WordPress 7.1, and the package reference states the module is deprecated: the menu item component renders nothing and the store’s conversion and editing actions do nothing. Core stopped using it in 2023. If you have a plugin importing from it, the replacement for entity work is @wordpress/core-data against wp_block entities — and be aware there is no public replacement for the conversion utilities or menu items, so code that converted blocks to reusable blocks programmatically needs rethinking rather than porting.

Nothing in 7.1 changed pattern overrides, so the four-block limit above still stands. The Block Bindings API did gain one block in this release — List Item — which is a bindings-only addition rather than an overrides one. If you are catching up on the release more broadly, the new responsive style controls are the change most likely to affect how you build a pattern in the first place.

So which should you use?

  • Header, footer, sidebar, or a loop region: template part. There is no real contest — these are addressed by templates, and nothing else can be.
  • A legal line, VAT number or disclaimer that appears mid-content on forty pages: synced pattern. One edit, forty pages, and an Editor-role user can do it without Site Editor access.
  • A section layout authors should fill in differently each time: unsynced pattern, registered in the theme’s /patterns folder so it stays in Git.
  • Identical design, different text, repeated many times: synced pattern with overrides — but only if your editable blocks are headings, paragraphs, images or buttons. Anything else, use an unsynced pattern and accept the drift.
  • Identical design, different text, driven by data rather than typed per page: skip overrides and bind the blocks to custom fields instead. One pattern in a Query Loop fills itself in from each post’s own values.
  • A client site with a deployment pipeline: put structure in theme files and keep synced patterns for content the client genuinely owns. Database-only reuse is invisible to your repo and to code review.
  • No file access at all — managed host, no SFTP: synced and unsynced patterns saved in the editor are your whole toolkit, and that is fine. Keep a plain-text export of anything important somewhere outside WordPress.
  • Coming off a page builder: patterns are the native replacement for its template library, and template parts for its theme builder. Comparing the major page builders against the block editor is worth reading before you commit either way, because the migration is the expensive part.

One habit that pays for itself: write down which reuse mechanism holds what. “Header and footer are template parts in the theme; the compliance footnote and the shipping banner are synced patterns; everything else is unsynced” is three lines in a README, and it saves the next person — usually you, in eight months — from editing a page and wondering why nothing changed.

Frequently asked questions

Are reusable blocks the same as synced patterns?

Yes. WordPress 6.3 renamed reusable blocks to synced patterns and moved them onto the unified Patterns screen. The storage did not change — both are posts of type wp_block — so reusable blocks created years ago keep working under the new name with no migration step.

Can I use a template part inside a post?

Not through the normal editor. The Template Part block is for templates, and it is not offered in the post inserter. If you want a reusable chunk partway down a post, that is what a synced pattern is for. Wanting a template part in a post is usually a sign the thing is content rather than layout.

Will my synced patterns survive switching themes?

The patterns themselves will, because they are posts and not tied to a theme. How they look is another matter: they reference colour and spacing presets by slug, so a new theme with different slugs can leave blocks falling back to defaults. Check a page using each important pattern on staging before switching.

How do I find every page using a synced pattern before I change it?

Get the pattern’s ID from wp post list --post_type=wp_block, then search post_content for its reference with wp db query and a LIKE on "ref":412, substituting your table prefix and ID. There is no admin screen that lists pattern usage, so this query is the only reliable answer.

Why can my editors not change the footer?

Because the footer is a template part and the Site Editor requires the edit_theme_options capability, which the Editor role does not have. Either make the editable piece a synced pattern placed inside the footer, which Editors can manage, or give those users administrator access — the first option is almost always the better trade.

Can I convert a synced pattern into a template part?

There is no conversion command, but the manual route is quick: open the pattern, switch to the code view, copy the block markup, and paste it into a new .html file in the theme’s /parts folder (or into a new template part created in the Site Editor). Then update the templates that need it and delete the old pattern once nothing references it.

Which blocks support pattern overrides?

Heading, Paragraph, Image and Buttons, and only some of their attributes — Image covers url, alt and title; Button covers url, text, linkTarget and rel. Overrides depend on the Block Bindings API, so a block that does not support bindings cannot be overridden, and there is currently no public way for a custom block to opt in.

Should patterns live in the theme or in the database?

In the theme, if you have file access. A pattern file in /patterns is reviewable in a pull request, deployable, and travels with the theme between environments. A pattern saved in the editor exists only in that database, which means it moves between staging and production in a database dump or not at all.

Sources

Leave a Reply to This Post