WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to include an entire flat-file HTML site (.html, folders/ and CSS) inside WordPress?

Essentially, I want to host an HTML site, but have access to WP functions and plugins. Not to interested in a iframe solution as that would break the look of the URLs on the browser address bar.

Can I include the html site in WP? Or perhaps include WP in the HTML (with some PHP .htaccess extension magic)?

share|improve this question
up vote 2 down vote accepted

First you need site to be processed as PHP, since WP simply won't work otherwise. I think you can do it for non-.php extensions by tinkering with server config.

THen see Integrating WordPress with Your Website in Codex. You can load WP core to required degree and use the functions.

However I'd consider just migrating site to WP completely.

share|improve this answer
Will simply grabbing the header in a standard PHP page as your link suggests load WP plugins? – jnthnclrk Aug 2 '11 at 21:30
Answered my own question by allowing themes with define('WP_USE_THEMES', true);. – jnthnclrk Aug 2 '11 at 21:32
Scratch that, turning themes to true doesn't really help plugins load. Hmmm... – jnthnclrk Aug 2 '11 at 21:46

If I had a site where I wanted to do this I'd convert the layout to a wordpress theme, and then import the pages -- playing with the URL format so that they'd correspond.

Creating a basic theme from existing HTML is pretty easy - see this tutorial for instruction:



You can leave out stuff you're not planning to support - for instance, you might not need the comments, gravatar, sidebars or posts if all you need is full-width pages.

If you can't replicate your URL structure perfectly with the normal WP custom permalinks options, consider redirecting with a plugin, like this one:


(I found this in the plugin directory, and haven't tried it or reviewed it closely. Evaluate carefully before using. ) A better option, if you can, would be to 301 redirect the old URLs to the corresponding compatible URL. You can use your .htaccess file, or a WP redirection plugin.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.