Skip to content
ThemesIonic — home
WordPress Tutorials

Adding a WordPress Blog to an Existing HTML Site

The installation is routine. The decision that actually matters is whether the blog lives at /blog or at blog.yourdomain.com, and it is much harder to change afterwards than to get right now.

4 min read intermediate

Put the blog in a subdirectory — example.com/blog — unless your hosting makes it impossible. Everything else in this job is mechanical. This one choice determines whether the blog builds up the reputation of the site you already have or starts from nothing alongside it.

The static site and the blog will be two separate applications either way. The URL structure is what decides whether the outside world reads them as one property.

Subdirectory versus subdomain

Subdirectory (example.com/blog) Subdomain (blog.example.com)
Treated as the same site Yes, unambiguously Usually, but not guaranteed
Link value from blog posts Accrues to the whole domain May be attributed separately
Hosting requirement Blog must be on the same server as the HTML site Can be on completely different hosting
Certificate Covered by the existing certificate Needs the subdomain covered too
Analytics One property, one set of sessions Cross-domain measurement to configure
Effort to change later Redirect every post URL Redirect every post URL

The subdirectory wins on merit. The subdomain wins on constraint: if the static site is on a host that does not run PHP and MySQL — a static file host, a CDN-only setup, a corporate server you cannot install software on — then the blog physically cannot live in a folder on it, and a subdomain pointed at WordPress hosting is the honest answer.

There is a middle route: keep the /blog URL and put a reverse proxy in front, so requests to that path are forwarded to WordPress on other hosting. It gives you subdirectory URLs without co-located hosting, at the cost of a proxy configuration that someone has to maintain. Worth it for an established site; overkill for a new one.

What you should not do is put the blog on a different domain entirely. That is two websites, and you will be maintaining two reputations.

Check what the hosting can do

Before anything else, confirm your current hosting runs PHP and can create a MySQL database. Static-only hosting cannot run WordPress at all, and finding that out after picking a URL structure wastes the effort. If the answer is no and you would rather move everything than run a proxy, WordPress hosting is the place to start.

Install into the subdirectory

  1. Back up the existing site. Download the full document root before touching it.
  2. Create the directory/blog inside the document root, not above it.
  3. Create a database and user for WordPress in your hosting control panel.
  4. Install WordPress into that directory. A one-click installer will ask for the target folder; make sure it is /blog and not the root. The manual route is covered in installing WordPress on cPanel.
  5. Confirm the static site still loads at the root before going further.
  6. Set permalinks to a post-name structure straight away, before publishing anything. Changing it later changes every URL — and if links 404 afterwards, permalinks not working explains why.
  7. Check HTTPS on both halves. A mixed setup where the blog loads insecurely produces a browser warning on the whole path — see fixing the not secure warning.

WordPress writes its rewrite rules into a .htaccess file inside /blog, which only affects that path. Your existing static pages are untouched.

Make it look like one website

This is where most of the remaining work sits, and where people overreach. Do not try to make WordPress emit markup identical to your hand-written HTML. Instead, rebuild the shared parts inside a WordPress theme:

  • Copy the navigation links and structure into a WordPress menu, so both halves offer the same routes.
  • Match the header and footer visually — same logo, same spacing, same colours.
  • Reuse the type and palette rather than approximating them. Your existing stylesheet already contains the exact values, so read them out of it rather than eyeballing a match.
  • Add a link to the blog in the static site's navigation, and links back to the main sections from the blog. Without these the two halves are technically joined and practically separate.

Starting from a close-enough theme and adjusting it is faster than building one — customising a WordPress theme covers how far you can get without code.

After launch

Submit one sitemap per property if you used a subdomain, or check that the blog's sitemap is discoverable from the root if you used a subdirectory. Run through the SEO checklist once, then leave it alone.

One honest observation: within a year or two, most people who bolt a blog onto a static site end up moving the static pages into WordPress as well, because maintaining two publishing workflows is tedious. Installing into /blog leaves that door open. A subdomain quietly closes it.

Frequently asked

A subdirectory is better in almost every case, because search engines treat it as unambiguously part of the same site and the blog's links and content strengthen the domain as a whole. A subdomain is the right choice only when the blog has to run on different hosting from the static site.
Not if you install it into its own subdirectory. It will if you install it at the document root, because WordPress adds its own index.php and rewrite rules there and the server may then stop serving your index.html. Back the site up before installing either way.
You can pull posts through the WordPress REST API and render them in your static pages, but visitors then read content that only exists client-side and the canonical version still lives on the WordPress side. Use it for a teaser list on the homepage, not as the way the blog is published.

Related guides