This is a question I get on a regular base: How can I convert my Static HTML to WordPress based website?
Let me give you a warning in advance, a WordPress website needs to be kept updated!
A static HTML site can run for years without you ever touching it for things like security updates or new versions. Just to make you aware of the need for updates!
Another thing that needs really close attention is to make sure that your rankings in Google and other search engines stay intact.
That means you need to make sure that the URLs of your old site will stay the same with your new WordPress based website.
Luckily this can be done and for those few links you want to change you can redirect them via your .htaccess file.
Convert Static HTML to WordPress
But first things first, the conversion of your website.
First, what do you need:
- good hosting that support php
- a mysql database: databasename, username for that database and the password for that useraccount
- the possibility to use a .htaccess file
If you are not sure about the above mentioned items, ask your website hosting provider!
Installing WordPress in a Subfolder
The first thing you will do is to install WordPress into a Subfolder like /cms .
After you finished the installation you have to set the Privacy setting so that Search Engines are not allowed to visit and index your site (Settings -> Reading) so your new URLs are not getting into the search engine indexes until you are ready with your conversion.
Now you can start building your WordPress website next to your current site, that site will stay active while you build a new one.
Keeping Old URLs
Like a mentioned before, it is very important that you keep the URLs for the new site the same as the old one!
That is why you need to set the Permalinks to custom with the value /%postname%.html this will result in Posts links with the extension .html.
During the development of your new site the urls will be like /cms/page-url.html , but after the final steps this will become /page-url.html , that same as the old site.
Make sure that the “slugs” are the same as the old site, and there is a plugin that you will need which is “.html on pages” . I take it you will have some pages that use the extension .html
You can now start to convert your old pages to WordPress by copying the text or the HTML code of the content from the old website into the HTML code screen of WordPress.
Your page URL is created by the Title of your page, but you can change them by editing the Slug permalink.
There is a plugin that could help you convert old pages: http://wordpress.org/extend/plugins/import-html-pages/ Attention! For this plugin to work you really need PHP5! Ask your hosting provider if you are not sure.
The conversion from your old static HTML to WordPress based site with the same layout is a completely different exercise than what I am describing here, to do that your will have to get a complete custom Theme / Layout.
But why not take this opportunity and change the look of your site together with the conversion? Choose a nice premium or free theme that will fit you company / website topic and customize it to your needs.
If you are happy with the look and feel and the content of your site you can follow these step to get it “live”:
1. delete or rename the index.html file in the root of your old site.
2. copy the index.php and .htaccess file from the /cms folder to the root of your site
3. change one rule in the index.php file into require(‘./cms/wp-blog-header.php’); (only with the index.php file in the root, not in the folder /cms!!)
4. change only the Site address (URL) in the general setting (Setting -> General) into the domain name. (remove the /cms part)
5. remove or rename the old .html files.
6. change the privacy settings so the Search Engines can access and index the site again.
If you handle the change over it this manner, than your old site is not reachable during the 5 minutes you need to rename the index.html so the index.php takes over and if you kept your URLs you are not loosing any visitors from the search engines like Google.
And of course you have taken a complete Back-Up of your old static website so you can restore your old side if you should encounter any unexpected error(s).
If you want new URLs for your pages than you can redirect the old URLs to the news ones in two ways:
- use a plugin http://wordpress.org/extend/plugins/redirection/
- via the .htaccess file in which you have to write a rule per url you want to forward: redirect 301 /olde-url.html http://www.example.com/new-url.html
However if you change your URLs, even with a 301 redirect you could loose some credit and backlinks that are pointing to your site.
Good luck and if you still have some questions, please use the contact form.
If you have other tips and additions that might help others, please write them in the comments section below.
One last question: Is there a need to have this information in an even more detailed form like a pdf manual with screen shots and tips? if so, please leave a comment.
Update: You asked for it and now it's finally here… From Static HTML To WordPress version 1.0
You can share the PDF with friends, post it on you website but you cannot sell it or change anything in it! If you find any language or grammatical errors please let me know so I can correct them.