The block editor can do almost anything, and that’s exactly the problem. Give an editor every option and, a year later, every page looks a little different: a slightly different blue here, an extra column there, a heading that’s bold on one page and not on the next. Locked patterns solve that by letting you decide which parts of a layout are fixed and which are content.
What a locked pattern is
A pattern is a reusable group of blocks, like a hero, a card grid or a call-to-action band. Editors insert it from the block inserter’s Patterns tab, and it drops in fully designed.
Locking controls what can happen to the blocks inside it. WordPress gives you a few levers:
- Block locking. Any block can be locked against moving, removing, or both. In the code this is the
lockattribute, and in the editor it’s the “Lock” option in a block’s toolbar menu. - Template lock on a container. A Group, Columns or Cover block can carry a
templateLocksetting.insertstops editors adding or removing blocks inside it but allows reordering.allfreezes the structure entirely. - Content-only editing. The
contentOnlylock is the one we use most. Editors can change text, links and images, but the layout blocks around them are hidden from the List View and their design controls disappear. The editor sees a form, not a puzzle.
Editors can still change the words and pictures. They just can’t knock the structure out of shape.
How we decide what to lock
We ask one question for each part of a section: if an editor changes this, does the page get better or worse?
- Content stays open. Headlines, paragraphs, images, alt text, links, button labels and list items are what editors are there to change.
- Structure gets locked. The number of columns, the order of a heading and its eyebrow, the spacing between sections, the position of the button.
- Style is limited, not removed. Instead of a color picker, editors choose from two or three block styles we designed, like a navy band or a light band.
That last point matters. Removing every choice makes editors work around the system, usually by asking a developer for one-off CSS. Offering a small set of designed variations covers most real needs.
Setting it up in a block theme
Most of the control lives in two places: the patterns themselves and theme.json.
- Register patterns in the theme. Each pattern is a PHP file in the theme’s
patternsfolder with a header (title, slug, categories). Keeping them in the theme means they’re version-controlled and identical across staging and production. - Lock inside the pattern markup. Wrap the pattern in a Group block with
"templateLock":"contentOnly", or add"lock":{"move":true,"remove":true}to individual blocks that must stay put. - Trim the design controls in
theme.json. Settingcolor.customandtypography.customFontSizeto false, and turning off the default palette, keeps editors on your presets. You can also set these per block undersettings.blocks, so a Button gets two colors while a Group gets four. - Register block styles for the approved variations, so “Navy band” and “Light band” show up as one-click options in the Styles panel.
- Decide who can unlock. By default, users who can edit can also unlock blocks. The
canLockBlockseditor setting, set through theblock_editor_settings_allfilter, lets you restrict locking and unlocking to administrators.
Synced patterns are a related tool. Edit a synced pattern once and every instance updates, which is right for something like a shared disclaimer or a sitewide promo band. Recent WordPress versions also let some synced patterns allow per-instance content overrides, which is handy, but it’s worth testing on your version before planning around it.
Template locking for whole pages
For page types that should always have the same sections, like a case study or a service page, we lock the template itself. Editors fill in the content, and the page structure can’t drift.
For custom post types, this is set when the post type is registered: a template argument lists the blocks a new post starts with, and template_lock controls whether editors can add, remove or move them. A team member profile, for example, can open with a photo, name, title and bio already in place, ready to fill in.
We use full template locks sparingly. Lock a whole page too tightly and an editor can’t add a single extra paragraph when a story genuinely needs it. A common middle ground is locking the hero and closing call-to-action, and leaving a content area in the middle open.
Mistakes we see
- Locking without the editor in the room. If the people who publish every week weren’t asked what they change, the locks will block real work. Sit with them for an hour first.
- Forgetting alt text. Content-only editing still exposes image alt text, but only if editors know to look. Mention it in training and in the pattern’s placeholder text.
- Too many near-identical patterns. Eight hero patterns that differ by one detail are harder to choose from than two with a style toggle.
- Not checking mobile. A locked layout that looks right on desktop can still stack badly on a phone. Test patterns at narrow widths before handing them over.
- Patching instead of patterning. When an editor unlocks a block to make an exception on a live page, the exception tends to spread.
What editors actually notice
Mostly, they notice it’s easier. Fewer options means fewer decisions, and every new page looks like it belongs on the site.
This matters most where several people from different teams post the same kind of content often, such as offers, events or announcements. A card pattern locked to content-only, with a couple of approved background styles, means new items go up quickly, and the page stays consistent no matter who posted what.
When editors do need something new, that’s a sign the design needs a new pattern, and we add one properly instead of improvising on a live page.
When to bring us in
If you already have a block theme and a short list of sections editors keep rebuilding, adding a few locked patterns is a manageable project for an in-house developer. If you’re starting from a classic theme, or the site has drifted enough that nobody’s sure what the standard layouts are, we can audit what’s there, define the patterns, and set up locking that fits how your team works. That’s a core part of our custom Gutenberg theme work, and you can always reach out with questions first.