Understanding WordPress Template Hierarchy

written by:
posted on: March 12, 2019

WordPress templates are files within a WordPress theme that control how your WordPress website will be viewed. They take information from your WordPress database and HTML code and send it to your web browser. WordPress allows you to have as few or as many templates in one theme as you like. You can configure each template to be used how you want.

Common WordPress Template Files

Archive Template is used when visitors request posts by author, category, date, or tag. However, it can be overridden if you have more specific templates present. For example, you might want your Category Template to have a certain look and style, but your author results have a different appearance.

Error/404 Template is used when WordPress cannot find a specific URL (post, page, or other content). Larger sites have more opportunities for broken links, so it is imperative that you have an optimized 404 page.

Index Template is the main template file for your WordPress theme. It is required for all themes. Often, this is the template for your blog posts homepage. Since it is such a valuable template, it is imperative that you test it on all devices and browsers.

Search Template displays posts when searching for a specific term or keyword. When people are searching, they are looking for content either based on images and text, so you want to make sure you provide enough relevant information in your results. Plus, your results should be easily scannable. Long-form search results do not optimize the readers’ experience.

Single Template is used for single posts. This template is where most of your traffic will visit (your content), and so it is important that you test single posts on different browsers and devices. Also, make sure to check out single posts loading times using Web.dev.

Page Templates only apply to pages to change their appearance. They can be applied to static pages, but not too dynamic templates such as Archive and Index templates. Examples of page templates in a few of my designs include the following: Julie Blanner’s Recipe Index, The Little Epicurean’s About page, and Street Smart Nutrition’s Resources. These pages are additional page templates beyond the default template. Not all themes come with multiple page templates.

Why is WordPress Templates Important?

As a blogger, WordPress templates are important when testing either your custom or premade theme. It is imperative that your site provides an optimal reader experience on different browsers and devices.

You might be thinking, “Of course! Why are you mentioning this?” Unfortunately, this practice is not true. In fact, most potential clients who reach out to me have at least one broken template in their design. I’ve had clients spend thousands of dollars on custom designs with other designers to have Search and Error templates not designed or developed. When looking at a custom developer, you want to ensure that they are quoting you for development of the complete theme, not just pages.

If you are testing a premade theme, you can simply view the different templates by permalink structure to ensure that the theme is completely developed and tested.

Do you have any questions about WordPress Templates? I’d love to hear your feedback! If you are interested in learning more about WordPress, make sure to subscribe to my WordPress newsletter here!

Understanding WordPress Template Hierarchy

Editor's Note

Some of the links included throughout this website are affiliate links, which means that Lindsay Humes LLC receives a small commission when certain items are purchased. These affiliate links provide a means for the site to earn revenue and generate free content for readers. For more details, read the privacy policy here.

Blog Design Lindsay Humes
Meet The Author: Lindsay Humes

Leave a Comment

Your email address will not be published. Required fields are marked *

Join The Blog Better Audit!

Subscribe to join thousands of other creatives, bloggers, and freelancers and receive my free email course on how you can improve your WordPress website. My newsletter is full of tips on how you can grow your audience with actionable exercises that do not require a designer or developer!