Guides/Edit your website/Templates/Template parts

Template parts

Template parts are pieces of a layout that can be reused across multiple areas of your site. The site header and footer are common template parts typically included with your theme. This guide will show you how to create and control the template parts on your site.

About template parts

If your site uses a theme that supports the site editor, you can use template parts. A quick way to determine if your site uses the site editor is to check under Appearance in your dashboard. If you have Editor here, you can access your site’s template parts using the following steps:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Click the “Patterns” menu option.
  4. Under the header “All template parts,” you’ll find template part groups (such as Header, Footer, and General).

Watch the video below to learn how to access template parts. Slow down or speed up the video using the controls in the lower-right corner after clicking the Play button.

Similar to patterns in your pages and posts, template parts can be reused throughout your templates — when you edit something inside a template part, your changes will update everywhere on your site that uses that template part.

Template parts can only be used on templates. If you add a template part and get the message, “The “Template Part” block cannot be inserted.” make sure you are not editing page or post content. Learn more about editing templates.

Your theme may include more than one header or footer template part. For example, it might include a header specific to your homepage and another version of the header for other pages.

Edit an existing template part

When you activate a theme on your site, several template parts will be included for you to customize as needed. To edit an existing template part, follow these steps:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Click Patterns, then “All template parts.”
  4. Click on the name of the template part, then click on the editing area on the right to open up the editor interface.
  5. Click on any block in the template part to edit it, or add a new block by clicking on the + block inserter icon (learn how to use the WordPress editor here.)
    • Tip: Use List View by clicking the three horizontal lines icon at the top of your screen. This is helpful to see a list of all blocks in your template part to see how everything is laid out. Using List View, you can move, remove, and add new blocks.
    • Tip: If you’re unsure how you’d like to design a template part like a header or footer, browse block patterns to use one of our premade designs.
  6. Once you have finalized your changes, click the “Save” button. Your changes will appear on the site everywhere the template part is used.

Watch the video below to learn how to edit template parts. Slow down or speed up the video using the controls in the lower-right corner after clicking the Play button.

Create a new template part

You can create a new template part to reuse across your site. One common reason to create a new template part is to create a different version of your header or footer to display on specific pages.

There are three methods you can use to create a template part:

From Patterns

To create a new template part from the Patterns section of the editor, follow these steps:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Click Patterns.
  4. Click the “Add New Pattern” button on the right.
  5. Select “Add New Template Part” from the menu drop-down.
    • Type a short name for your new template part that describes what it’s for.
    • Select an area of your site for your new template part: General, Header, or Footer.
    • Click the “Create” button.
  6. Click the + block inserter icon to insert any blocks or patterns you wish to have in your template part.
  7. Once you have finalized your design, click the “Save” button.

The new template part will now be available to insert into templates.

From the Editor

You can create a new template part while editing any template. Follow these steps to create a new template part from the editor:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Click on the right side of the screen to open the editing interface for the Home Page template.
    • Or, navigate to Templates to select the specific template you want to edit.
  4. Click the + Block Inserter icon and search for “template part”. Click to add it to the page.
  5. You will then be presented with two options:
    • Choose: Pick from one of the template parts that came with your theme, like the header and footer.
    • Start blank: Create a new template part from scratch by giving it a name and clicking the “Create” button.
The template part block after you first add it, showing the options to Choose, or Start blank.
  1. Click the + block inserter icon to insert any blocks or patterns you wish to use.
  2. Once you have finalized your design, click the “Save” button.

The new template part will now be available to insert into templates.

From existing content

You can create a template part from existing content or content you have created in any of your templates. Follow these steps to turn content in a template into a template part:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Click on the right side of the screen to open the editing interface.
    • Or, navigate to Templates to select the specific template you want to edit.
  4. Select multiple blocks, or add new blocks, and click the three dots () in the toolbar that appears.
  5. Select the “Create template part” option and:
    1. Type a short name for your new template part that describes what it’s for.
    2. Select an area of your site for your new template part: General, Header, or Footer.
    3. Click the “Create” button.
  6. Once you have finalized your design, click the “Save” button.

The new template part will now be available to insert into templates.

Watch the video below to learn how to create a template part from existing template content. Slow down or speed up the video using the controls in the lower-right corner after clicking the Play button.

Add a template part to your site

Once you have finalized the design of an existing or new template part as described in the previous sections, you can insert the template part onto your site. Here’s how:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Select the template you want to add the template part to.
  4. Click the + block inserter and search for the name of your template part. Click to add it.
    • Alternatively, search for “template part” and click to add this to your site. Then click “Choose” to browse through your site’s template parts.
  5. Click the “Save” button.

Move a template part

You can move a template part to another location in your template by following these steps:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Select the template you want to edit, or click the preview of your site to open the Site Editor.
  4. Open List View in the top-left corner of your screen (it’s the icon that looks like three horizontal lines above each other.)
  5. Click the name of the template part in the List View.
  6. Use the up/down arrows in the toolbar that appears after you click a template part, or drag the template part to a new location in List View.
  7. Click the “Save” button to save your changes.

Moving a template part works the same way moving an individual block does. If you need additional help, take a look at our guide on how to Select and Move Blocks.

Delete a template part

Deleting a template part is irreversible – there is no way to recover a template part once it has been deleted. To delete a template part:

  1. Visit your site’s dashboard.
  2. Navigate to Appearance → Editor to open the Site Editor.
  3. Click Patterns, then “All template parts.”
  4. Click the ellipses (three dots) next to the name of a template part.
  5. Select the “Delete” option.
    • The delete option will not appear for the theme’s default template parts.

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!