◦ Comprehensive security
◦ 24/7 support
WordPress Guide → Pages → Custom Page
How to create a custom page template in WordPress (3 ways)
Need a landing page that doesn’t show the sidebar? Or a full-width layout for your portfolio? WordPress custom page templates give you the freedom to break away from your theme’s default design—without overhauling your entire site.
Whether you’re customizing directly in your theme, using the block editor, or working with a page builder, creating custom templates lets you control how individual pages look and function.
Here’s everything you need to know to do it right.
Get fast, reliable hosting for WordPress
Power your site with the industry’s fastest, most optimized WordPress hosting
What is a WordPress page template?
A page template is a file that controls the layout and design of a specific page in your WordPress theme. Templates determine how your header, content, sidebar, and footer are arranged—or whether they appear at all.
By default, most themes use a single page.php file to render all pages. But when you create a custom page template, WordPress lets you override that default on a per-page basis. This is perfect for:
- Landing pages with a stripped-down layout
- Unique designs for contact, about, or portfolio pages
- Full-width content areas
- Pages without navigation or footer links
You can assign a custom template to any page from the WordPress editor.
Why use a custom page template?
Custom page templates give you fine-grained control over your layout without touching the rest of your theme. Here’s why they matter:
- Design flexibility: Customize page structure, hide elements, or add new ones without affecting global files.
- Speed: Build faster-loading pages by stripping out unnecessary scripts or elements.
- User experience: Create more focused layouts that guide users toward a specific goal—like filling out a form or making a purchase.
They’re especially useful for marketers, developers, and site owners who want to optimize individual pages for conversions or engagement.
Creating a custom template using the block editor
If you’re using a block-based theme, you can create custom templates right inside the Site Editor.
Here’s how:
- Go to Appearance > Editor (Site Editor).
- Click the Templates panel.
- Click Add New and choose Page.
- Give your new template a name (e.g., “Landing Page”) and start editing.
- Use blocks to add or remove headers, footers, content areas, etc.
- Save your changes.
Once it’s saved, you can assign this template to any page by editing the page and selecting it under Page > Template in the sidebar.
This is the simplest method if your theme supports full site editing (FSE).
Creating custom page templates manually in theme files
If your theme isn’t block-based—or if you need deeper control—you can manually create a PHP file for your custom template.
Step 1: Create the template file
In your theme folder (or preferably a child theme), create a new file. Name it something like page-custom.php.
At the top, add a special comment so WordPress recognizes it as a template:
<?php
/*
Template Name: Custom Landing Page
*/
This template name will appear in the editor dropdown.
Step 2: Add your layout structure
You can start by copying your theme’s page.php or index.php file, then modify it. Or you can start fresh:
<?php
/* Template Name: Custom Landing Page */
get_header(); ?>
<div class=”custom-container”>
<main id=”main”>
<?php
while (have_posts()) : the_post();
the_content();
Endwhile;
?>
</main>
</div>
<?php get_footer(); ?>
Customize this template however you want—remove sidebars, add custom sections, change HTML structure, or enqueue specific styles.
Step 3: Assign the template
In the WordPress dashboard:
- Edit any page.
- In the right-hand panel, find the Template dropdown.
- Select “Custom Landing Page” (or whatever you named it).
That page will now use your custom layout.
Using a page builder plugin for templates
WordPress page builders like Elementor, Beaver Builder, and Divi let you create custom layouts without writing code.
Here’s how it works in Elementor, for example:
- Install and activate the Elementor plugin.
- Create a new page or edit an existing one.
- Click Edit with Elementor.
- Build your layout using widgets, columns, and sections.
- Publish the page.
Elementor Pro also allows you to create reusable page templates and assign them based on conditions—like page type, user role, or URL.
Other page builders offer similar functionality, and most are compatible with custom templates if you prefer to mix code and visual editing.
Tips and best practices
- Use a child theme: Never edit your main theme’s files directly. Always use a child theme to avoid losing changes during updates.
- Name templates clearly: Use descriptive template names in your file comments so they’re easy to find later.
- Limit hardcoding: Keep content in the WordPress editor, not in the template file. This keeps things editable for clients or content editors.
- Test across devices: Always preview your custom templates on desktop, tablet, and mobile.
- Avoid bloated templates: Strip out unnecessary scripts or widgets if performance matters—especially on landing pages.
Advanced options for developers
If you’re building more dynamic templates, you might want to:
Register templates programmatically using the theme_page_templates and add_filter() functions
- Use get_template_part() or locate_template() to modularize template parts
- Combine ACF (Advanced Custom Fields) with custom templates for flexible content layouts
- Use template hierarchy strategically—page-{slug}.php or page-{ID}.php will override even selected templates
Getting started with custom page templates in WordPress
Custom page templates let you take full control over your layout—no extra plugins or full redesigns required. Whether you go the no-code route with the block editor or dive into PHP for more precision, custom templates help you build smarter, more effective pages.
Start by creating a basic custom template in a child theme, then assign it to a test page. From there, iterate and expand as your site grows.
Ready to upgrade your WordPress experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy. Liquid Web’s WordPress hosting options configure business-class servers and support plans specifically for WordPress websites.
Don’t want to deal with server management and maintenance? Our fully managed hosting for WordPress is the best in the industry. Our team are not only server IT experts, but WordPress hosting experts as well. Your server couldn’t be in better hands.
Click through below to explore all of our hosting for WordPress options, or chat with a WordPress expert right now to get answers and advice.
Additional resources
How to build a WordPress site →
A complete beginner’s guide that covers 9 key steps to a successful launch
WordPress excerpt length: What it is, how to change it →
Discover how to adjust the excerpt length in WordPress to improve content previews.
How to use WordPress Gutenberg blocks →
A complete beginner’s guide to Gutenberg blocks