top
wp estore

How To Convert A Static HTML Site To WordPress

Recently, on a forum I frequent, an old acquaintance asked how to convert one of his old Dreamweaver sites to WordPress, with the least amount of effort involved. At first, I thought it would be impossible to make it an easy task, but after seeing some other responses, I realized I was wrong. Although the process isn’t completely trivial, it can be done with a lot less effort than I’d originally imagined. And it’s not just limited to Dreamweaver. Nearly any site could conceivably be converted to WordPress this way. (Note that I’ve included some reasons at this end of this post as to why you might want to carefully consider the ramifications of this).

If you have an old non-CMS site lying around that you wish you could convert to WordPress, without too much hassle, this is the guide for you. Essentially, it boils down to 2 main steps, which involves moving your static content into WordPress’s database as pages or posts. STEP ONE: Get your static HTML pages gathered together in one place, using HTTrack to build those static pages, if necessary. STEP TWO: Import those pages using an easy WordPress plugin.

Let’s start with some basics. No matter how your site is coded, once a visitor loads a page on your site, the browser takes all the bits and pieces (server-side includes, images from another directory, etc.) and puts them all together in what amounts to a final static HTML page. Even if some elements on the page are still dynamic, the code itself is all together in one spot that can be moved into a WordPress page that would still work. There may be some exceptions to that which I’m not considering, but for most of the sites out there, that would be true. So, even if your site consists of somepage.php, which calls a file named header.inc, and a file named footer.php, once the user views somepage.php in her browser, the resulting source code is all in one place, as though it were hand-coded as a static HTML page. This is the type of code that is needed to convert a site to WordPress using the method I’m outlining here.

If you already have an old static HTML site with no server-side includes, then you have everything you need to get your content right into WordPress. If that’s the case, you can skip the next section, and head straight to the section titled “Import Your Content Into WordPress”.

Convert Your Dynamic Pages To Static Pages Easily

HTTrack Website Copier lets you download an entire website onto your computer. If your pages are dynamically put together, using server-side includes to automatically insert chunks of content into each page (like the header, footer, and menu), then you’re going to want to have HTTrack mirror the site – with all content already inserted – and recreate it on your computer. It doesn’t take very long, but of course, how long it will take depends upon the size of your site. Luckily, you just run it and go do something else, and eventually, the entire site will be recreated and waiting for you. There are lots of options for how you can run this. Most of you will simply use the graphical interface instead, and if so, then you should be able to determine what to do pretty easily. The manual has lots of screenshots to help.

Personally, I like running this from the command line on my Linux computer, and I like using the -K option to use absolute urls in the links. When I run this from the command line, I use something like this:

httrack http://www.yoursite.com -O /home/you/somefolder -K

But I can’t guess at what your exact code should be, if you decide to use the command line instead of the graphical interface. You’ll need to read through the documentation to determine what’s right for you.

Regardless of how you run HTTrack, or what options you choose, once you have a folder that contains your entire site, all in a static HTML format, you’re ready to move it into WordPress.

Import Your Content Into WordPress

Start by installing a fresh copy of WordPress. Then add the following plugin and activate it.

Import HTML Pages WordPress Plugin

Once activated, open up its options page and make a few choices there. You can choose either to create pages or posts (not both). When I used it, I chose pages. Now you need to tell it how to recognize “just the content” (without all the surrounding template code, sidebar, footer, etc.). My content was surrounded by a div with an id of “content” (<div id=”content”>all my content was here on each page</div>), so that was easy, but as long as your content is surrounded by some sort of consistent, unique HTML tag, you can just specify that.

Once you’ve set all the options, you’re ready to run it. Very quickly, you’ll have a new WordPress blog with all the pages of content that match the content of your old site.

At this point, you may need to either recreate the template as a WordPress theme or use a new design. Personally, I think using a new design at this point is a good idea. It’s probably time for your old site to get a fresh new design facelift, right? In any case, converting an HTML template to a WordPress theme is beyond the scope of this post. There are tons of tutorials on how to do that on the web, so I won’t try to reinvent that wheel here.

You may also need to make a few tweaks including possibly some redirects if needed, but all in all, in probably just a few minutes, you’ve converted your old static HTML site to a new, easy to maintain WordPress site.


Final notes: Before you attempt this, you should carefully consider all the possible ramifications of making this change.

1. While WordPress makes maintaining a site very easy, and comes with some powerful modern advantages, there are some possible reasons to reconsider. For one thing, a static site is almost always going to load faster than a dynamic one, especially one that involves a database. If your site receives tons of traffic, a less-than-great server can probably handle the load if it’s serving static pages much better than it can handle serving a highly-traffic’d WordPress site. If this sounds like it may affect you, you might need to consider also upgrading to a better server and/or hosting company.

2. There may be some issues with URLs changing. There’s a good chance that you’ll need to adjust every page’s slug to match your old page URLs, or you’ll need to deal with redirecting all the old URLs to the new ones.

3. Some things may not work. It’s impossible to really guess at what those things might be, but maybe you have some pages on your site that use some sort of script to output some sort of crazy whatchamacallit. That script or whatchamacallit may not play well with WordPress.

The best idea is to do this conversion first as a test on a development site to see what gotchas might crop up. Since it’s fairly quick and easy to do, running a test first might save some headaches later on.


Tags: , , ,

Article Summary:
How To Convert A Static HTML Site To WordPress

Recently, on a forum I frequent, an old acquaintance asked how to convert one of his old Dreamweaver sites to WordPress, with the least amount of effort involved. At first, I thought it would be impossible to make it an easy task, but after seeing some other responses, I realized I was wrong. Although the [...]

51 Responses to “How To Convert A Static HTML Site To WordPress”

  1. Glenn Gordon (6 comments) says:

    At last, easy to understand instructions from someone who can articulate. Very informative and a great help. Although, sadly I’m not sure if it would work for my site?

    • Donna (587 comments) says:

      I looked at your site, and think it could be converted to WordPress with very little problem. Yours might require a little extra thought but I don’t think it would be difficult.

  2. Glenn Gordon (6 comments) says:

    Unfortunately, the import option only works on WordPress.org and not WordPress.com, which is a real shame. WordPress.org isn’t very user friendly, despite its claim.

    Although, HTTrack Website Copier is a great tool and creates a mirror of the site, there is no sign anywhere of where it is located on the hard drive, despite having run it several times. It seems to have vanished, so it isn’t possible to import anyway.

    • Donna (587 comments) says:

      True. Anytime I speak of WordPress, I’m referring to the self-hosted variety, not wordpress.com. The .com version is virtually useless for so many reasons, including being unable to monetize with it, unable to use whatever plugins and themes you want, and so much more. If you think wordpress.org isn’t user friendly, then trust me, wordpress.com is far less user friendly unless you never plan to do anything outside of the limited cage they lock you into.

  3. Glenn Gordon (6 comments) says:

    I guess my only other option is to use one of Dreamweaver’s own templates instead and copy my entire site onto it.

    I still can’t understand the index problem with Google though, since I added it some time ago.

    • Donna (587 comments) says:

      Whoops, I accidentally replied via email instead of here. What I said there was, “Adding it is no guarantee of anything. A technical problem could cause it to not be indexed, or Google may have banned the site for some reason. “

  4. Glenn Gordon (6 comments) says:

    Do you think converting my site to a pre designed Dreamweaver template would solve my problem?

    • Donna (587 comments) says:

      It would solve the design issues. It probably won’t solve the indexing issue, and of course, it definitely won’t enable the functionality of WordPress.

  5. Glenn Gordon (6 comments) says:

    Well, the design issue seems to be the main problem for visitors, as it isn’t really fair on them, if they find my site interesting, but are frustrated because they experience difficulties in reading it. I’m sure Dreamweaver has plenty of free templates I can copy it onto, although I’m dreading working with html coding, as i had hoped it would just be a matter of copying all the code onto Notepad, then re-pasting back onto a new template. I’ll also have to consider changing the background colour and font size/colour.

    HTTrack Website Copier is a great tool to have in my toolbox, so I’m gonna keep it.

  6. Glenn Gordon (6 comments) says:

    Hi Donna

    I was just wondering what you thought of my idea about re-pasting my website onto a new template, as I thought that might fix a lot of the problems visitors were having?

    • Donna (587 comments) says:

      As I said above, it will probably solve the design issues. So, yes, it may be worth doing.

  7. Mohamed Osam (2 comments) says:

    Thanks Donna for sharing. Static pages as you stated above will always load faster, but of course very limited capabilities. I always recommend static pages for simple sites.

    WordPress or any other CMS for that matter can bring your server down to its knees, especially when you load the CMS with tons of plugins that are poorly programmed or even optimized but too many activated for the kind of capabilities you are looking for. Caching IF done correctly can be a tremendous performance enhancement and allow you to scale.
    Mohamed Osam recently posted..Boost Business By BloggingMy Profile

  8. Peter (2 comments) says:

    Thanks for this great article. I have been looking for this for a long time now because I wanted to put my site in WordPress, because wordpress got really great features for your site. Thanks.
    Peter recently posted..kantoormeubelenMy Profile

  9. LGR (1 comments) says:

    Thanks for this post it could come in handy in the future. I have been converting a lot of HTML website to WordPress for clients lately but have been using the CSVPig plugin and a script to copy the content into a CSV file and then import it into WordPress. It works well if the HTML code is not to dirty. If the HTML of the existing site is not very good the output can be unpredictable.

    Might have to give this plugin a try instead.
    LGR recently posted..WordPress BackupMy Profile

  10. Donna (587 comments) says:

    For the person named Fanis, who tried to comment here asking for help, the code you included caused your comment to not show up. You asked why you were having a problem when you upload your content to import-html-pages. You probably shouldn’t put your content there. Place it in a folder on your server outside of the wordpress admin. That still may not fix the issue, I’m not sure. Complete instructions for using the plugin are at http://sillybean.net/downloads/html-import/user-guide.html . There’s also a support forum at http://forum.sillybean.net/forums/forum/html-import-2/ . This isn’t my plugin, so I don’t have all the answers.
    Donna recently posted..Shift and Bend With The Swirling Winds Of ChangeMy Profile
    Twitter:

  11. Athos Pelekanos (1 comments) says:

    I have been having terrible problems with my HTML site since I decided to leave the original guy who created it. He may have created my site but did think about any onpage SEO.

    I have joined forces with some really cool guys who use mainly WordPress & they keep on saying, yes we’ll go in and do the onpage SEO for you but it’s going to take ages as you’ve got so many pages, then they always say, if only you had a WordPress site, things would be so much simpler – now I can pass this info from you site onto them, they will be so pleased.

    Many thanks

    Athos

  12. Jasmin (0 comments) says:

    Great guide!

    I still have some static sites that would do better with wordpress and this should make sure I wont make any mistakes converting them. I love wordpress as it gives you so much flexibility :)

    Jasmin
    Jasmin recently posted..Wiz Khalifa QuotesMy Profile

  13. Jeff Casmer (2 comments) says:

    Thanks you! This is a great resource. I have a wordpress blog and wanted to convert my static html front page to wordpress and the task seemed daunting till I read this.
    Jeff Casmer recently posted..MLM Is A Great Home BusinessMy Profile

  14. Aaron Siegel (1 comments) says:

    Okay. I am a bit late for this article post. Wish I had red this some years ago, however, who knows if it even would have been possible then. I know one thing, whoever is planning the transition will be lucky to stumble across this.

    Aaron Siegel

  15. Mani Viswanathan (1 comments) says:

    Nice tut Donna. But the drawback of this process is that the design (CSS) won’t be converted. But again worth a try when in need.
    Mani Viswanathan recently posted..How to create a Google+ Page for your BlogMy Profile

  16. Bruce (4 comments) says:

    My very first site was made with Xsitepro and though it has stood the test of time, I’d like to convert it over to WP, as I keep forgetting how to operate xsitepro, but I’m in WordPress every day.

    Your instructions will help me immensely. Thanks

    ~Bruce
    Bruce recently posted..Bird Feeder Online ShoppingMy Profile

  17. Dave Pilgrim (1 comments) says:

    Thanks Donna. I am always looking to improve my content and this really helps.
    Dave Pilgrim recently posted..Fun apps wanted for your iphone?My Profile

  18. Vanita (1 comments) says:

    OMG, Thank you so much for this. I’ve been recreating websites in WordPress for clients thinking the only way to convert was from scratch. Thanks so much. I really appreciate this post. It’s wonderful. Thank you.
    Vanita recently posted..Organize Your Blog for Better Business Part 2My Profile

  19. ecuador crafts (2 comments) says:

    thankyou sooo much for this geat blog…before i converted from scratch thinking this was the only way to recreate websites in wordpress

  20. eddy (0 comments) says:

    Thanks Donna,

    G+ your blog post because of its great content! Thanks again for the value :-) .
    eddy recently posted..Jerky | Smaken en SoortenMy Profile

  21. Carlos Pundik (1 comments) says:

    Thanks for this info! I’m trying to incorporate WordPress as a blog into my existing site, so this comes in VERY handy!

    Thanks!

  22. tagua (1 comments) says:

    really helpful blog, just what i needed! was glad to learn that static pages load faster, i only want to create a simple site
    tagua recently posted..Nov 7, Salinas, Ecuador: An Income-Producing Finca, Working Farm for SaleMy Profile

  23. Erin (1 comments) says:

    What an awesome article. Only four Facebook likes? For shame! :p

    Thanks for laying out the options. Looks a lot easier than I thought it would be. The hardest part will be reconstructing the directory structure, I think.

  24. Rizwan Sultan (5 comments) says:

    That’s great to see but how we deal with browser compatibility issues.Because most of time HTML to WordPress conversion is not compatible for IE,chrome and Firefox.
    Rizwan Sultan recently posted..motivation blogMy Profile

    • Donna (587 comments) says:

      Dealing with the theme is a separate issue, and that’s what will be involved in being cross-browser. The content shouldn’t affect it, or if it does, it would have before anyway. But if you decide to go with a new design (and frankly, in most cases, it’s time for a new design anyway if the site was old and still-static), then you can choose one that is already cross-browser compatible.
      Twitter:

  25. Peter Meyer (2 comments) says:

    My site has lots of informative articles but is mainly for marketing my 20+ Windows programs. I started it in 1997 using HTML 3.0, and started using PHP in 2002, and it has been continuously developed since then. The user interface does not look as good as a professional website designer would do it, and some people have suggested making use of WordPress (and a nice website template for the home page). Reportedly this would improve my SERPs also. But I see a problem. My 20+ product pages, and my product purchase pages, make use of product data stored in PHP arrays. Also a customer can get an activation key online immediately after purchasing a user license and this is done with a lot of fairly esoteric PHP coding. So it seems clear that my site can’t be converted to static HTML. And if it can’t be, then it can’t be converted to WordPress, right? Or more generally, any site which relies on a lot of PHP is not a candidate for conversion to WordPress, right?

    • Donna (587 comments) says:

      WordPress is powered by PHP, so that’s not really an issue. Now, that being said, you’ll probably need the help of someone familiar with creating WordPress themes, who can properly integrate your PHP code into the site. But it can certainly be done.
      Twitter:

      • Peter Meyer (2 comments) says:

        Thanks for informing me that it is possible, though I suspect far from easy and would take some considerable time. Maybe I’ll get a new .com domain (I’ve often wondered whether my .ch domain puts me at a disadvantage in Google SERPs), and keep it private while I try to reconstruct hermetic.ch in WordPress, keeping the same site structure, then if the attempt succeeds I would 301-redirect everything to the new site so as to keep my Google rankings.

  26. Kevin (2 comments) says:

    Really nice work Donna Easy to understand and step by step information really help even a newbie to convert the site to WordPress.
    Thanks a lot for such a wonderful post.

  27. Kenny (1 comments) says:

    I was searching for a guide like this since I am trying to convert my old static website into WP blog. Will try your advices and report back how it went. Thanks Donna ;)
    Kenny recently posted..How To Repair Laptop Hard DiskMy Profile

  28. increase internet speed (1 comments) says:

    such a great idea sharing this useful tips and information in how to convert static site’s into wordpress..such a valuable post..thanks..!!
    increase internet speed recently posted..Garmin Navigation SolutionsMy Profile

  29. best coffee maker (1 comments) says:

    Thank you for sharing this blog . I am looking forward to your inforamtion and going to start a blog this year. And seeking for your more help in the future.

  30. Dennis (2 comments) says:

    Great easy to understand guide. I think even the most novice users can understand it. Thank you, Donna!

    Warm wishes,
    Dennis
    Dennis recently posted..CES 2012: First Day, First Product ReleasesMy Profile

  31. Altaf Hussain (1 comments) says:

    Just tried step one on an html site I need to convert to WP. I installed WP in root of the site, copied my index.html to the default theme and renamed as you suggested. Then renamed my index.html page. Loaded the site and you could not tell that anything had changed. Best of all there was no messing with the .htaccess file

    You have one slick method here. Verry Nice.
    Altaf Hussain recently posted..Crohns DiseaseMy Profile

  32. Ανεμογεννητριες (1 comments) says:

    thanks for the info!! i’ll try it … greetings from greece!
    Ανεμογεννητριες recently posted..Τζάκι ναι, αλλά με διαρκή… επαγρύπνησηMy Profile

  33. Sweta (0 comments) says:

    finally i got a very easy to understanding content to solve my query.

    thanx for this article.
    Sweta recently posted..Very Funny JokesMy Profile

  34. Shakil (0 comments) says:

    I have tried.
    it’s really Work.
    Good Tips
    Thnx For sharing.
    Shakil recently posted..Himachal Gramin Bank Recruitment 2012 for Bank Officer and Office AssistantMy Profile

  35. Gaijin (1 comments) says:

    It helps a lot! I have a lot of clients who need this kind of service when they refresh their website, and it’s always a headache to work it out, especially when they have Dreamweaver-type messed-up code. Many thanks for this tutorial!
    Gaijin recently posted..Japanese directories – SEO building tacticsMy Profile

  36. Jerry Gonzales (1 comments) says:

    Thanks for the wonderful post, it’s such a relief to find this. I’m planning to get WP as the platform of my site since it is most recommended by my friends. Having a hrad to find ideas on how to transfer my contents to it, I’m not a code geek either. Thanks for thetutorial. It’s very useful!
    Jerry Gonzales recently posted..Plane out of Chicago Airport makes emergency landingMy Profile

  37. Mic (1 comments) says:

    Hey I followed the steps your described and it worked just fine. I was on the edge to hire a web designer for this task but thanks god I found your blog post in the last minute ;)

  38. Juliana (2 comments) says:

    This is a good timing. I had been thinking yesterday how would I convert Static HTML site into wordpress could it possible? Yay! Glad I found this post. it helps a lot. Thanks!
    Juliana recently posted..Pivot Doors – for a grand entry..My Profile

  39. Sadie-Michaela Harris (1 comments) says:

    Really helpful post and generous share that will benefit many Donna… I’m about to share it as a following from a short blog post I wrote earlier today and Shared in Mari Smith’s Inner Circle community. Your post will help answer the follow up. :)
    Sadie-Michaela Harris recently posted..WordPress- How to take a non WordPress website and rebuild in WordPress maintaining the SEOMy Profile

  40. zac (1 comments) says:

    This is great information! Never thought that converting a html page to wordpress could be this easy
    zac recently posted..Ibike bicycle accessories for IphoneMy Profile

  41. laura (6 comments) says:

    This article is great when you have new customers who need content for their static website and you’re not a brilliant programmer. :D

CommentLuv badge
top