Working with someone recently made it apparent the process to move a static site to Wordpress has been made a lot harder than it needs to be. Here is the easiest way to convert a static website to a Wordpress blog. You will not have to do any redirects or modify any files other than in the Wordpress admin area.
Let’s assume we have 3 static pages, Index.html, about.html and products.html and we want to move to Wordpress.
- Install Wordpress in the root of this domain.
- Immediately copy the Index.html to the WP Theme (whichever theme you are using) folder, and rename it Home.php
At this point, your site will look to the world just like it always did. Wordpress will automatically use the home.php page as the default, and now you can go about putting it all together. You should have no broken links or any worries about redirects.
- Leave the permalinks with their default settings. This keeps you from having problems with existing pages.
- Copy the contents from About.html and create a page called About
- Copy the contents of your other files and make pages with the exact same names. If your page names are different than the titles, you can edit the permalink to match the filename (without the html extension).
- Once the data is copied and you have the look you want, change the permalink to /%postname%.html
- For PAGES (Not POST) to use the HTML extension you need a plugin as Wordpress only applies the Permalink structure to the posts. Recommended HTML Extension Plugin -> Wordpress Hero
- Install this Plugin first for the pages.
- Remove the old static pages, I suggest keeping them just in case you have a problem, but you need to move them out of the root.
- Copy the index.html contents to the file you want to be your home page, and delete the Home.php file. Typically this is the index.php in the theme, however you may want to use a static page depending on the site setup. You can change this is the WP Settings.
At this point, your conversion is done.
- Index.html has been copied to home.php http://test.cybercoded.com/
- Original About.html still in place http://test.cybercoded.com/about.html
- Wordpress Version of About has been created http://test.cybercoded.com/?p=48
- Additional page has been created http://test.cybercoded.com/?p=44
All I have to do is change the permalink and remove the old files and I am done.
There, no need to mess with your .htacess file, and no need to worry about redirects, let the system handle it for you.
And yes, I have done several sites like this.
I also use the Home.php method to park a page if I need time to work on it before going live.
Wednesday, January 21st, 2009
Written by: David Cooley
Posted in Blogging, Programming
Tags: Static Web Site, Wordpress, Wordpress Conversion, Wordpress Hierarchy