Sciencetext Tips & Tricks
Blogging tips, browsing tricks and computing hacks

Converting a Wordpress Blog into a Static Site

July 9th, 2007 · by David Bradley

wordpress logo deletedSome time ago, I built a simple little website for UK hydroseeding company CDTS Ltd. Cambridge Direct Tree Seeding convert brownfield and other sites into lush landscaped areas.

Initially, I suggested to the company that there would be several advantages to running their site as a blog, allowing them to add their own content on an ad hoc basis, and so keep their clients and potential clients up to date with company developments and achievements. As the brief evolved, however, CDTS decided that it wanted a static website, with the option to add new content as and when it was needed, rather than to run the whole site as a blog. Trouble was I had built the site as a Wordpress blog with all the attendant plugins, posts, paraphernalia.

So, how to convert a Wordpress blog with half a dozen posts and a couple of Pages into a static site? I am sure there are various methods, but the simplest approach was to simply save the whole site to a folder on your hard drive and open it for editing in an old-style html/website editor. Quickest way to do that is simply to browse to the homepage, in this case the hydroseeding site and choose “Save as…” from the File menu, choose a suitable location in My Documents and then open up the site in your html editor. Multiple file search and replace comes in handy for automatically stripping various chunks of Wordpress code, fixing image locations, and not forgetting to save the CSS file to the site folder too. Rename the index file as index.html

Next step is to backup the original Wordpress installation, just in case. Then, fix up the .htaccess file (basically remove the Wordpress section and make .html the default file extension rather than .php for the index file. While you’re there, you might check your canonical domain redirect to make sure you are pointing domain.com with a 301 (permanent) redirect to www.domain.com.

Finally, remove the installed Wordpress files (having remotely backed up) and then upload the “Saved as…” version just edited. A quick scan with Xenu reveals any missing or faulty links. So back to the html, couple of quick fixes and another upload of the errant files. Xenu now clean. New site, static-ized. Done.

One thing I would like to do with the site is to use CSS to generate the graphical display so that I could slot in different photos for the four-photo gallery at the top of each page, rather than creating a unique header image for each page of the site. That would allow me to chop and change images on each page much more easily without having to fire up Photoshop and do a whole lot of slicing and dicing. If any SigFig readers can advise on a simple way to do that, I’d love to hear from you.

By the way, hydroseeding is the art of converting a brownfield or other barren site into a lush, ecologically rich and esthetically pleasing environment using a special selection of seeds, fertilizer and water and spraying the site selectively with appropriate seed mixes. CDTS Ltd were the UK pioneers of the technique and have carried out hydroseeding (or hydraseeding) right across the England and Wales.

10 responses so far ↓

  • jeremy // Jul 11, 2007 at 12:02 am

    For a company website that doesn’t change much that is a good idea. Then of course it’s harder to get noticed on the web, and harder to build a community, but those are all client problems right? Gotta give em what they ask for… sigh.

  • David Bradley // Jul 11, 2007 at 7:14 am

    A website can still change and evolve without it relying on blogging structure or software. There is, of course, another alternative to simply making a blog-type site entirely static and that is to use Wordpress as a content management system with a dynamic homepage, but exclude “The Loop” if the client does not wish to have any dynamic posts/comment content.

  • David Szpunar // Jul 21, 2007 at 4:46 pm

    We’re actually converting our existing custom-PHP website at work into a “static” site with WordPress as the CMS. Means easier templating, easy to edit pages as needed without special software (Dreamweaver) and without modifying the template. Plus, we change the main page weekly, and will likely use Posts for this page, just displaying the most recent one–no one will ever know it’s a blog most likely, although we may make the feed available if people want to subscribe to the weekly news that way.

    The plugins, flexibility, and my familiarity with WordPress already made it a no-brainer as the choice. There’s already a plugin to do almost everything we need, and if there isn’t I can write one or customize one and still make it easy to upgrade the WordPress core with new versions without having to re-edit the customized code.

    Plus, security holes are found and fixed the by community, rather than custom code which we’ve had some security problems with in the past. Just not enough eyes to cover it all!

  • David Bradley // Jul 23, 2007 at 3:24 pm

    Yeah, good way to go if you need to use a CMS and want all the pros of Wordpress. Like I said, this particular site is now entirely static, which means no worries about insecure plugins, dynamic page generation, or anything else related to WP and CMS come to that. Simple as it is, it does it’s job for the company very well (they tell me)

  • David Szpunar // Jul 23, 2007 at 3:30 pm

    I suppose it comes down to: update often or not? A static site will scale well and has less security vulnerability surface area, but if your goal is to keep the site updated with fresh information continually (especially across multiple people maintaining the site), a CMS is worth the extra effort and resources.

    I like your post either way; I hadn’t actually thought of converting from WordPress to static before. It’s not something I’ll likely ever do, but it’s good to think about what others are doing once in a while; it stimulates new ideas. Thanks.

  • David Bradley // Jul 23, 2007 at 4:08 pm

    Horses for courses and all that. The guys at CDTS opted not to have the blogging option. Of course, frequently updated content and new information are the lifeblood of blogs , but are not necessarily that important to everyone who wants a website.

  • David Szpunar // Jul 23, 2007 at 4:13 pm

    Nope…and if you look like you need new information and don’t have it, you’ll look worse than if you put up static information that doesn’t say “last post three years ago” :-) Now, you may not get as much attention from search engines, etc. since they do like new stuff, but if you don’t want to commit the resources to stay updated, don’t make a site you have to update! I see this mistake all the time on sites where they didn’t really know how much time it would take to keep the site updated so it reflects poorly on them.

    I think we’re in full agreement.

  • David Bradley // Jul 23, 2007 at 5:59 pm

    I think we most certainly are. From the SEO perspective it is worth having a site that is fresh, but if the site is #1 for its keywords on the basis of skillful setup it doesn’t really matter too much in the end.

  • Makeda // Feb 6, 2008 at 2:59 pm

    I am thinking of converting my blog into a website with my own url. I have my blog on blogger. Is it possible to do the same?

    Makeda’s last blog post..The Single Girls Guide to Valentine’s Day

  • David Bradley // Feb 6, 2008 at 3:14 pm

    It most certainly is - check out this post and make sure you thoroughly research redirects and other such matters here and elsewhere there is lots of advice and at least one plugin to help with the process. But remember there are no guarantees.

    http://www.sciencetext.com/blogger-custom-domain.html

    db

Leave a Comment

Comments are checked for spam before appearing, no need to post it twice.

Related Posts