Page template in WordPress is a PHP file that controls how a specific page or group of pages is displayed. While most pages on a WordPress site use the default page layout defined by the theme, a page template lets you assign a different layout or structure to individual pages — removing the sidebar, adding a custom header, displaying a full-width layout, or loading entirely unique markup depending on the page’s purpose.
Page templates give developers fine-grained control over page presentation without modifying the core theme files. They’re one of the primary tools for building sites where different pages need genuinely different layouts: a homepage that looks nothing like the standard content page, a landing page with no navigation, a full-width contact page, or a portfolio display with custom markup. Understanding how page templates work helps you communicate clearly with your development team about what’s possible — and what a given layout change requires.
[Image: WordPress page editor showing the “Template” dropdown in the sidebar with options for Default, Full Width, and Landing Page templates]
How Page Templates Work
WordPress uses a template hierarchy — a predefined lookup order it follows to determine which PHP file to use when rendering any given page. For standard pages, WordPress looks for page-{slug}.php, then page-{id}.php, then the generic page.php. A custom page template sits outside this default hierarchy and is explicitly assigned to a page through the WordPress editor.
To create a custom page template in a classic theme, a developer creates a PHP file with a specific comment header:
<?php
/*
* Template Name: Full Width
* Template Post Type: page
*/
get_header();
// Custom layout markup here
get_footer();
Once this file is placed in the active theme (or child theme), WordPress detects the Template Name declaration and makes it available in the page editor’s Template dropdown. The developer or editor can then assign it to any page. With Full Site Editing (FSE), the same concept exists using block-based templates instead of PHP files — but the purpose is identical.
Purpose & Benefits
1. Customized Layout Per Page Type
Different pages serve different functions, and those functions often call for different layouts. A landing page designed to convert visitors shouldn’t have the same navigation, sidebar, and footer as a blog post. Page templates let you build the right layout for each page’s purpose — removing friction for visitors and reinforcing the intended user flow. Our WordPress development services include custom page templates for every project that needs them.
2. Separation of Layout and Content
When a page template handles the layout, the person editing the page only needs to manage the content — not the markup. This separation makes content management simpler and safer. Editors can update copy, swap images, and publish new pages without risking unintended layout changes. The template enforces structure; the editor fills it with content.
3. Reusable Across Multiple Pages
A page template created once can be applied to any number of pages. If you need 12 service pages that all follow the same layout — full width, hero image, two-column text section, CTA block — you build one page template and apply it to all 12. If you later want to change the shared layout, you update one PHP file and the change propagates to every page using that template.
Examples
1. Landing Page Without Navigation
A company running paid ads wants visitors to arrive on a focused landing page with no header navigation — reducing distractions and keeping attention on the conversion goal. A developer creates a Landing Page template that calls get_header('landing') to load a simplified header with just the logo and phone number. This template is assigned to all paid traffic landing pages.
2. Full-Width Portfolio Display
A creative agency wants its portfolio pages to span the full browser width without a sidebar or the standard content column width constraints. A Full Width page template removes the sidebar and adjusts the container markup to allow full-width sections. The designer then builds the portfolio layouts within this unconstrained space.
3. Custom Archive-Style Team Page
Rather than a standard page with manually entered team bios, a developer creates a page template that automatically queries all “Team Member” custom post types and renders them in a grid. The content editor doesn’t need to update this page manually — adding a new team member post automatically updates the Team page because the template dynamically pulls the content.
Common Mistakes to Avoid
- Editing template files in the parent theme — Changes made directly to a parent theme’s template files are lost when the theme updates. Always create custom templates in a child theme or a custom theme to preserve your work.
- Creating too many similar templates — If your “Full Width,” “Landing Page,” and “No Sidebar” templates are nearly identical, consolidate them. Redundant templates create maintenance overhead and confusion for content editors.
- Confusing page templates with FSE templates — In classic themes, page templates are PHP files assigned per-page. In FSE/block themes, templates are block-based HTML files managed in the Site Editor. The concepts are parallel but the implementation is entirely different.
- Forgetting to add the Template Post Type header — Without the
Template Post Type: pagedeclaration, WordPress may make the template available for other post types as well, creating unintended assignment options.
Best Practices
1. Create Templates in a Child Theme
Any page template you create should live in a child theme, not the parent theme. This ensures your custom templates survive parent theme updates. If you’re building a fully custom theme, this isn’t a concern — but for sites using third-party themes, the child theme is the right home for custom PHP files.
2. Name Templates Clearly and Descriptively
Use template names that communicate purpose clearly: “Full Width — No Sidebar,” “Landing Page — No Navigation,” “Team Archive.” Vague names like “Custom 1” create confusion for future editors and developers. Good naming makes the template system self-documenting for anyone who works on the site later.
3. Document Custom Templates for Site Handoffs
When handing a custom WordPress site to a client or another developer, document which custom page templates exist, what they do, and which pages use them. This information often lives in a site documentation file or README in the theme directory. Well-documented templates prevent future editors from accidentally assigning the wrong layout and creating unexpected display issues.
Frequently Asked Questions
What’s the difference between a page template and a WordPress theme?
A WordPress theme controls the overall design of your site — fonts, colors, header structure, footer layout. A page template controls the layout of a specific page or type of page within that theme. The theme is the design system; the page template is a variation of that system applied to a specific context.
Can I assign the same page template to multiple pages?
Yes — that’s one of the primary advantages of page templates. Once a template file exists in your theme, it appears in the Template dropdown for every page and can be assigned to as many pages as you need. All pages sharing a template update simultaneously when the template file is changed.
How do page templates work in Full Site Editing themes?
In FSE-compatible block themes, there are no PHP page templates in the traditional sense. Instead, you create and manage block-based templates through the Site Editor (Appearance → Editor). These templates use the same conceptual logic — different layouts for different page types — but are built with blocks rather than PHP. See Full Site Editing for details.
Do page builders replace page templates?
They serve overlapping but distinct purposes. A page builder like Elementor handles the content layout within a page. A page template controls the structural scaffold around that content — whether a sidebar appears, what header variant loads, how the container is structured. In practice, page builders and page templates work together: the template sets the structural context, and the builder fills the content area.
Related Glossary Terms
- Custom Post Type Template
- Full Site Editing (FSE) Template
- WordPress Theme
- Child Theme
- Page Builder
- Full Site Editing (FSE)
- Post Template
How CyberOptik Can Help
As a WordPress-focused agency, we build custom page templates on every project that needs them — whether for landing pages, service pages, portfolio layouts, or custom archive displays. If your site needs pages that look different from the default theme layout, custom templates are the right solution. Get in touch to discuss your project or explore our WordPress development services.


