Skip to content
WordPress Guide

WordPress Site Editor: Templates and Template Parts

A plain guide to the WordPress Site Editor: what templates and template parts are, how to edit them without surprises, and how to undo or reset changes.

A desk with website wireframes, a phone and coloured pens
9 sections · 7 min read
In this article · 9 sections

Appearance → Editor is the screen many owners avoid. It is full of words like templates, template parts and patterns, and anything you change there can show up on every page at once. Yet in a block theme it is the main place where the header, the footer and the layout around your pages can be changed.

The WordPress Site Editor is less mysterious once you know the difference between a template and a template part, and once you know that almost anything you change there can be put back.

Do you have the Site Editor at all?

Open Appearance in the dashboard. If you see Editor in the list, your theme is a block theme and this guide applies. If you see Customize, Widgets and Menus instead, you have a classic theme, and your header and footer are edited through the Customizer and the theme’s own settings. Some classic themes show a Design or Patterns item instead. That opens a cut-down version of the same editor, mainly for patterns, so most of this guide will not apply.

If your header was built with Elementor or another page builder, the builder controls it, even on a block theme. Our guide to the header, footer and menus explains how to tell which setup you have.

Templates and template parts in the WordPress Site Editor

A template is the layout for a type of content. One template decides how all your blog posts look, another decides how pages look, another handles the home page, search results or the 404 page. A theme usually ships with a set of them: Pages, Single Posts, Blog Home, Archive, Search, 404 and a fallback called Index.

A template part is a reusable piece that templates share. The header and the footer are the obvious ones; some themes add a sidebar or a comments section. Each template includes the header part at the top and the footer part at the bottom, with its own layout in between.

This gives you a simple rule:

  • Change a template part, and the change appears on every template that uses it. Edit the footer once and every page, post and archive shows the new footer.
  • Change a template, and the change affects only content using that template. Removing the post date from Single Posts does not touch your pages.

The text of an individual page, such as your About page, is not in either. It belongs to the page itself and is edited under Pages like normal content.

Finding your way around the editor

When you open Appearance → Editor, recent versions of WordPress show a sidebar with a few sections: Navigation, Styles, Pages, Templates and Patterns. The names have shifted a little between versions, so look for these ideas rather than exact labels.

  • Templates lists every template with a short description. Select one to open it.
  • Patterns holds your saved patterns and, in recent versions, the template parts, grouped as Header, Footer and General.
  • Navigation lets you edit your menus without opening the header.
  • Styles controls fonts, colours and spacing for the whole site.

Inside a template, open List View (the three-line icon near the top left). It shows the structure as a tree, and template parts appear with their names, such as Header. Clicking a part in List View selects it; the block toolbar then offers an option to edit it on its own, which is the clearest way to work on just the header or footer.

Editing a template part safely

The footer is the usual first job, so it makes a good example. The same steps apply to the header.

  1. Go to Appearance → Editor → Patterns and choose the Footer template part. If your version lists template parts separately, look there.
  2. Open List View before changing anything, so you can see which Group, Row or Paragraph holds the text you want.
  3. Make one change at a time: edit the text, swap a link, move a block. The undo arrow in the top toolbar steps back through your edits for as long as you stay on this screen.
  4. Press Save. WordPress shows a list of everything that has changed, which can include templates, template parts and global styles. Read it. If something you did not mean to change is ticked, untick it before saving.
  5. View the live site in a private window to check the result.

The save list in step 4 is the best protection you have. It is easy to nudge something in a template while looking for the footer, and the list shows you before it goes live. The editing work for specific jobs is covered elsewhere: changing the footer text, for instance, has its own guide, as does making the header stay visible on scroll.

Editing a template, and giving one page a different layout

Open a template from the Templates section and you can change the layout around the content: remove the featured image from posts, add a call-to-action under every post, or make pages full width. The main content area appears as a Post Content block. Leave that block where it is, because it is what pulls in each page’s own text.

If you want a different layout for a few pages only, do not edit the main Pages template. Create a new template instead (there is an add button in the Templates section) and choose it for those pages in the page editor’s Template setting. The rest of the site keeps the original layout.

Where your changes are stored, and why it matters

When you edit a template or template part, WordPress saves your version in the database. The theme’s own files are left as they were. Two things follow from this.

  • A theme update does not overwrite your edited header or footer. Your customised version keeps priority. The flip side is that if the theme author improves that template in an update, you will not see the improvement until you reset yours.
  • A theme switch leaves your edits behind. Customisations belong to the theme they were made in. Switch to another block theme and you start from that theme’s header and footer.

Undoing changes: revisions and Reset

There are three levels of undo, from smallest to largest.

  1. Undo in the editor. Works until you leave or reload the screen.
  2. Revisions. Recent versions keep revisions for templates and template parts, much like pages. Look for a revisions entry in the template’s details in the sidebar. You can step back to an earlier saved state. Our guide to restoring an older version with revisions explains the compare screen.
  3. Reset. In the Templates list or the template part’s options, a template that came with the theme and has been customised shows a Reset option (older versions called it Clear customizations). It removes your saved version and brings back the theme’s original. Templates you created yourself have a Delete option instead.

Reset is useful when a header has been edited so many times that nobody knows what is in it. Be aware that it throws away every customisation in that template or part, not just the last change. Copy any text you want to keep first.

Mistakes to avoid

  • Detaching a template part. The block toolbar offers to detach a template part, which turns it into ordinary blocks inside that one template. The template then stops following the shared header, and later header changes will not reach it. Edit the part instead.
  • Deleting the Post Content block from a template. Every page using that template will show the header and footer with nothing in between.
  • Saving everything without reading the list. Untick changes you did not intend.
  • Editing on the live site when a lot is changing. For a bigger rework, try it first on a staging copy of the site.

For the bigger picture of looking after the site, the WordPress site owner’s handbook sets out what an owner usually handles and where each task is explained.

Frequently asked questions

Why does my change show on some pages but not others?

Different content types use different templates. If you edited the header inside the Pages template by detaching it, or a theme uses a separate header part for the home page, the change will not appear everywhere. Check which header part each template includes in List View, and edit the shared part rather than a single template.

Can I copy a template part to make a second version?

Yes. You can create a new template part from a selection of blocks, or duplicate an existing one from its options menu in recent versions. A second header is handy for a landing page that needs fewer links. Give it a clear name so nobody edits the wrong one later.

What is the difference between a template part and a synced pattern?

Both are reused, and editing either one changes it everywhere it appears. A template part is a structural area, such as the header or footer, that templates include and that belongs to the theme. A synced pattern is a piece of content, such as a call-to-action box, that you can drop into any page, post or template.

Will other editors on my site be able to change templates?

By default only users who can edit theme options, which normally means Administrators, can open the Site Editor and change templates. Editors and Authors can work on posts and pages but not on the header, footer or templates.

Templates that several people have edited over the years can end up with nothing lining up. Our WordPress theme customisation service can rework them, or build a layout the theme does not offer, and leave you a note of what was changed.

Next in this series: How to Add a Sticky Header in WordPress

Is Your Website Working Properly?

Get a free website health check from WebMaintor. We'll review your website's speed, security, forms, and technical health — and tell you exactly what needs attention.

No obligation. No automated reports. A real review by our team.