Adding a custom page template to WordPress via FTP is a simple way to create unique page layouts without relying on plugins. By creating a custom PHP file with the proper template header and uploading it to your active theme, WordPress will automatically recognize it as a selectable page template.
This guide explains how to create and upload a new WordPress page template using FTP.
What Is a WordPress Page Template?
A page template is a PHP file that controls the layout and functionality of specific pages on your WordPress website. Unlike the default page template, a custom template allows you to create specialized landing pages, sales pages, contact pages, or any layout that differs from the rest of your site.
Once added to your theme, the template becomes available from the Page Attributes (Classic Editor) or Template settings (Block Editor).
Why Use FTP to Add a Page Template?
Using FTP is useful when:
- You cannot access the WordPress Theme Editor.
- Your hosting provider disables file editing from the dashboard.
- You prefer editing files locally.
- You’re developing custom themes or child themes.
Step 1: Create the Template File
On your computer, open a code editor such as:
- Visual Studio Code
- Notepad++
- Sublime Text
- TextEdit (Plain Text mode on macOS)
Create a new PHP file and add the following code at the very top:
<?php
/*
Template Name: My Custom Template
*/
?>
The Template Name value is what WordPress displays in the page template dropdown.
For example, if you change it to:
Template Name: Landing Page
WordPress will list Landing Page as an available template.
Step 2: Add Your Template Code
Below the template header, you can either create an entirely custom layout or load your theme’s standard content.
A basic starting point looks like this:
<?php
/*
Template Name: My Custom Template
*/
get_header();
?>
<main class="site-content">
<h1><?php the_title(); ?></h1>
<?php
while ( have_posts() ) :
the_post();
the_content();
endwhile;
?>
</main>
<?php get_footer(); ?>
This template uses your theme’s existing header and footer while displaying the page content.
Step 3: Save the File
Save the file with a descriptive name, such as:
template-custom.phppage-landing.phptemplate-contact.php
Avoid spaces in the filename.
Step 4: Connect to Your Website Using FTP
Use an FTP client such as:
- FileZilla
- Cyberduck
- WinSCP
Log in using your FTP credentials provided by your web hosting company.
Navigate to your active theme folder:
public_html/
└── wp-content/
└── themes/
└── your-active-theme/
If you’re using a child theme, upload the template there instead.
Step 5: Upload the Template
Upload your new PHP file into the root directory of your active theme.
For example:
wp-content/themes/your-theme/template-custom.php
Once the upload is complete, WordPress automatically scans the theme and registers the new template.
Step 6: Assign the Template to a Page
In your WordPress dashboard:
- Go to Pages.
- Create a new page or edit an existing one.
- Locate the Template setting.
- Select My Custom Template (or whatever name you assigned).
- Click Update or Publish.
The page will now use your custom layout.
Troubleshooting
If your template doesn’t appear:
- Verify the file has a
.phpextension. - Ensure the template header is at the very top of the file.
- Upload it to the active theme or child theme.
- Clear any caching plugins or server cache.
- Confirm there are no PHP syntax errors.
Best Practices
- Use a child theme whenever possible so updates to the parent theme won’t overwrite your custom files.
- Give templates descriptive names that are easy to identify.
- Test changes on a staging site before deploying them to a live website.
- Keep backups of your theme before editing PHP files.
Frequently Asked Questions
Where should I upload a custom page template?
Upload the PHP file to your active theme’s directory:
wp-content/themes/your-active-theme/
Using a child theme is recommended to preserve your customizations during theme updates.
Can I create multiple custom page templates?
Yes. Simply create additional PHP files, each with its own unique Template Name.
Does WordPress detect templates automatically?
Yes. As long as the template header is correctly formatted and the file is inside your active theme, WordPress will automatically list it in the page editor.
Can I edit the template after uploading it?
Yes. You can modify the file locally and upload the updated version via FTP, or edit it directly through your hosting file manager if available.
Final Thoughts
Adding a new page template through FTP is a straightforward way to customize your WordPress site’s layout. By creating a PHP file with the proper template header, uploading it to your active theme, and assigning it to a page, you can build landing pages, custom layouts, and specialized designs without modifying your theme’s core files.
For long-term maintainability, always use a child theme and keep backups before making changes to your WordPress theme files.

One thought on “How to Add a New Page Template in WordPress Using FTP”
That’s a really useful tip. I’ve always found FTP to be a reliable way to tweak things directly, it’s great to see it explained so clearly.