How to convert HTML to WordPress with your rankings intact

To convert HTML to WordPress, you split every static page into two parts. A theme holds the design: layout, CSS, header and footer. The content moves into the WordPress database, where editors change it from the dashboard. Your old site serves a fixed file for each page, while WordPress builds each page on request. Once the header lives in one template, a menu change is one edit instead of 30.
There are four ways to make that split, and the table below picks one for you. Follow the steps for your method, then do the redirect work before launch. Skip that part and the rankings your old site earned go with it.
Before you start
Get these in place first. Each one is harder to sort out halfway through a build.
- Hosting that meets the requirements. WordPress recommends PHP 8.3 or greater and MySQL 8.0 or MariaDB 10.11 or greater. The current release line is 7.1, and version 7.1.3 shipped on October 6, 2026.
- A staging copy. Build and test there, never on the live domain.
- A backup of the old site. Keep the full set of HTML files, images and scripts somewhere safe.
- A list of every old URL. Crawl the static site now, then add any page that Search Console shows getting impressions. You'll need the list for redirects.
- The right skills. Methods 1 to 3 need someone comfortable with HTML and CSS. Method 2 also needs basic PHP.
Choose how to convert HTML to WordPress
Two questions settle it. Do you need to keep your current design almost exactly? Does anyone on your team write PHP?
| Method | Keeps your design? | Skills needed | Best for |
|---|---|---|---|
| 1. Block theme built from your HTML | Yes, rebuilt in blocks | HTML, CSS, block markup, some JSON | New builds where editors should change layouts themselves |
| 2. Classic PHP theme built from your HTML | Yes, closest to the original code | HTML, CSS, PHP | Developers who want to reuse existing markup |
| 3. Child theme of an existing theme | Mostly, restyled to match | CSS, a little PHP | Simple sites that already resemble a theme |
| 4. Content imported into a ready-made theme | No, you adopt the theme's look | Little to none | Teams that want a redesign anyway |
No to both questions points to method 4. If you want to keep the design and have a developer, it's method 1 or 2, and for a site you'll run for years, lean toward 1. Method 3 only makes sense when a theme already looks close to what you have.
Sometimes the right answer is not to convert at all. A five-page site that changes twice a year is fine as static HTML: it's fast, cheap to host and has nothing to patch. WordPress swaps hand-editing for plugin updates, PHP upgrades and an admin login to secure. If your site is really an application, with logins, calculators or approval workflows, WordPress becomes a wrapper around custom code. Custom software development is usually the cleaner path there. And if your team already runs a JavaScript front end it likes, look at headless WordPress, where editors use the dashboard and the front end reads content through the API.
Method 1: build a block theme from your HTML
The WordPress developer handbook calls block themes "the modern method of building WordPress themes". Their templates are HTML files made of block markup, and editors can change them in the Site Editor (Appearance > Editor) without touching code. For a custom theme started today, this is the format to pick.
Step 1: create the two required files
A block theme needs only two files: style.css and templates/index.html. The first holds the theme's name and description. The second is the fallback template, and its presence tells WordPress the theme is a block theme.
Step 2: add theme.json
Put a theme.json file next to them. The handbook describes it as the place for everything from configuring colors to default typography. You set colors and fonts once instead of scattering them across stylesheets.
Step 3: turn your header and footer into template parts
Cut the header and footer out of your HTML file and save them as parts/header.html and parts/footer.html. Then reference them from each template. This sketch is adapted from the handbook's own template example:
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-group">
<!-- wp:post-content /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
Step 4: rebuild each layout in blocks
Recreate the sections of your old pages with core blocks such as Group, Columns and Cover. Move color and font settings into theme.json, and keep only the CSS that blocks can't express in style.css. Check every template at phone width before you move on.
Step 5: export the finished theme
The Create Block Theme plugin, published by WordPress.org, can create a blank theme, a child theme or a clone of the active theme. It saves your Site Editor changes back to the theme files and exports the result as a zip. A practical pattern is to start blank, rebuild your pages in the Site Editor, then export. The Site Editor's own Tools > Export option also downloads a zip of your templates and styles.
You rebuild here rather than reuse, so it takes longer up front. In return, editors can change layouts without filing a ticket.
Method 2: convert HTML to a classic PHP theme
Most older tutorials describe this route, and it still works. The handbook confirms the classic PHP-based templating system is still supported in WordPress today. It's the fastest way to reuse your existing markup nearly line for line.
Step 1: create the theme folder
Make a folder in wp-content/themes/, for example acme-theme. A classic theme needs only an index.php file and a style.css file. Most themes also split out header.php, footer.php and sidebar.php.
Step 2: write the style.css header
The comment block at the top of style.css tells WordPress what the theme is. Start with Theme Name, then Author and Author URI. Fields such as Author, Version, Requires PHP, License and Text Domain become required only if you submit the theme to the WordPress.org directory. Paste your existing CSS below the header.
Step 3: split your homepage into three files
Open your homepage HTML file and cut it up:
- header.php gets everything from
<!DOCTYPE html>down to where the main content starts. Callwp_head()just before</head>, andwp_body_open()right after the opening<body>tag. That second hook has existed since WordPress 5.2. - footer.php gets everything after the main content. Call
wp_footer()just before</body>. - index.php pulls in the header, runs the Loop and pulls in the footer.
The Loop is how WordPress steps through the posts for a page and prints each one with your markup:
<?php get_header(); ?>
<main>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</main>
<?php get_footer(); ?>
Step 4: enqueue your CSS and JavaScript
Don't hardcode a <link rel="stylesheet"> tag in header.php. The handbook says to load stylesheets with wp_enqueue_style from functions.php, hooked to wp_enqueue_scripts:
function acme_theme_assets() {
wp_enqueue_style( 'acme-style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'acme_theme_assets' );
Load scripts the same way with wp_enqueue_script. Copy your images, fonts and scripts into the theme folder and update their paths.
Step 5: add templates and a screenshot, then upload
Add templates for other page types as you need them. WordPress uses page.php for static pages and single.php for single posts, and falls back to index.php when nothing more specific exists.
Save a 1200×900 screenshot as screenshot.png in the theme folder. Zip the folder, go to Appearance > Themes > Add New in the admin, upload it and activate it. Then move each page's content into a new WordPress page.
Method 3: restyle a child theme
When an existing theme already resembles your layout, a child theme spares you a build from scratch. It inherits everything from its parent and overrides only what you change, so parent updates won't wipe out your work.
- Install the parent theme. You don't need to activate it.
- Create the child folder in
wp-content/themes/with a kebab-case name, such asacme-child. - Add style.css with a Template line. The value must exactly match the parent's folder name, for example
Template: twentytwentyfive. This file is the only one a child theme strictly needs. - Enqueue styles if needed. If the parent doesn't load your stylesheet, enqueue it from
functions.phpwithget_stylesheet_uri(), as in method 2. - Upload, activate and port your CSS from the old site one section at a time.
With a block parent such as Twenty Twenty-Five, most styling lives in theme.json, so you'll often skip step 4. The risk with this method is bending someone else's markup toward your design. If the two structures differ a lot, you'll spend longer overriding the parent than you would on method 1 or 2.
Method 4: import your content into a ready-made theme
If you're open to a new look, skip the theme work. Choose a theme, then bring the content in. A theme or page builder that lets you lay out pages visually gets you close to your old layouts without code.
How you move the content depends on the size of the site. For a few dozen pages, the most reliable converter is a person with two browser tabs. Paste each page into the block editor, then check headings, images and links. Upload images to the Media Library so they're served from the new site, not the old server. It's slow, and it gives the cleanest result.
For a form embed, a pricing table or a widget you want to keep exactly as coded, add a Custom HTML block by typing /html in the editor. Since WordPress 7.0, the block has separate panels for HTML, CSS and JavaScript.
For a large site, an import plugin can save days, but check its age first. HTML Import 2 by Stephanie Leary imports a folder of static HTML files as pages or posts. It keeps your directory structure, pulls titles and content from tags you choose and generates a list of Apache redirects. Its WordPress.org page also shows it was last updated in 2017, tested only up to WordPress 4.6, and may no longer be maintained. Run it on a staging copy with a fresh backup of your files and database. For hundreds of pages, a short script that parses your HTML and creates pages through the WordPress REST API is often more predictable.
Protect your rankings before launch
Static sites often use URLs like /services.html, while WordPress uses clean paths like /services/. Every URL that changes needs a redirect, and this is the step that quietly costs teams traffic.
- Start from your URL list. It's the crawl plus Search Console pages you gathered before you started.
- Map old to new, one to one. Send each old URL to its true replacement, not to the homepage.
- Add permanent 301 redirects. Google says 301 and other permanent redirects don't cause a loss in PageRank. Point each old URL straight at its final destination, with no chains. The Redirection plugin manages 301s and logs 404 errors, or your developer can add rules at the server.
- Keep the redirects for at least a year. That's Google's minimum, so its systems can transfer signals to the new URLs.
- Submit the new sitemap in Search Console. Google notes that for medium-sized sites, it can take a few weeks or more for the new URLs to appear.
Carry over title tags, meta descriptions, image alt text and heading structure as well; an SEO plugin gives each page a field for them. Then crawl the staging site for broken links and missing images, and test forms, navigation and mobile layouts. If you sell to US customers, run an accessibility check against WCAG on the new templates. A rebuild is the cheapest moment to fix it.
If you bring in our WordPress development services team, the URL map is the first thing they'd build, before any theme code. It decides how much of your old traffic survives the move.
Troubleshooting common conversion problems
Most problems after a conversion trace back to a handful of causes.
- Plugin features or scripts don't show up. Check that
header.phpcallswp_head()andfooter.phpcallswp_footer(). WordPress and most plugins print their scripts through these hooks, so leaving one out breaks things quietly. - Styles don't load. Remove any hardcoded
<link>tags and enqueue the stylesheet fromfunctions.php. Then check that image, font and script paths point at the theme folder. - The child theme ignores the parent. Look at the Template line in
style.css. It must match the parent's folder name exactly. - Editors can't change the text. This is typical of converter output, where text sits hardcoded in template files. Move that content into WordPress pages so it lives in the database.
- A script or iframe vanished from a Custom HTML block. The CSS and JavaScript panels appear only for users with the
unfiltered_htmlcapability. For everyone else, WordPress strips tags such as<script>and<iframe>on save, so have a user with that capability add the embed. - Images still load from the old server. Upload them to the Media Library and update the references.
- Old URLs return 404 errors. The Redirection plugin's 404 log shows which ones. Add a 301 from each to its real replacement.
FAQ
Is there a free online HTML to WordPress converter?
Yes. Converters come as online tools, browser extensions and plugins, and they're best for prototypes. Most wrap your markup in theme files, so you get your look back, but text often stays hardcoded and menus aren't real WordPress menus. Before you use one, check where the content lands, whether the theme calls wp_head() and wp_footer(), and that you're comfortable uploading the site to a third party.
Do I need to know PHP to convert HTML to WordPress?
Not always. A block theme uses HTML templates and a theme.json file, and importing content into a ready-made theme needs no code at all. A classic theme does need basic PHP, because its templates are PHP files.
Should I convert the site myself or hire a developer?
Do it yourself if the site is small, your team writes HTML and CSS, and nobody's revenue depends on organic search next quarter. Methods 3 and 4 are within reach of a capable generalist. Bring in a developer when you have hundreds of pages, custom functionality or rankings you can't afford to lose.
Start with the URL list
Whichever method you choose, the crawl of old URLs is the step that gets harder after launch, once the old site is offline. Do it this week, even if the theme work waits a month. When you're ready to build, our WordPress team can take on the theme and the redirect map together. Tell us about your site.
Related reading
Embedded systems programming: how firmware is structured, written and testedJuly 28, 2021 · 12 min read
eLearning management systems: 18 LMS platforms grouped by who you trainDecember 16, 2024 · 13 min read