« How Not To Get Your Blog HackedScott And Scurvy »

Using WordPress to Generate Flat Files

Some readers have emailed asking me for more specifics about how to run WordPress offline, like I suggested in my last post. So I spent a couple of hours struggling with it last night to get a sense of what it would take.

This is an almost useless and jargon-packed summary, but my hope is that some intrepid WP user may try following these steps and use them as a starting point for a proper HOWTO.

  1. If you want comments, you'll need to switch from whatever is built in to WordPress to an outside JavaScript-based service like disqus. Disqus can import your existing comments when you set it up. Disclaimer: I have never used this service and know nothing about it - there may be better alternatives.

  2. Set up WordPress on the machine where you want to do your writing and editing. The WP site has copious instructions for all kinds of installation scenarios.

  3. Configure WP to use 'fancy' permalinks - not the default, which uses query string parameters. Basically, if there's a question mark in the URL, you can't mirror the site. If you're on OS X, you will now have to struggle with mod_rewrite and .htaccess permissions for a while.

  4. Configure WP to allow robots access (otherwise wget will not work in the next step).

  5. Use wget to crawl your new blog and turn it into a bunch of static files:
    wget --mirror -p --html-extension --convert-links http://your.local.url/
    What this does is explained in detail here. I've left off some unnecessary flags.

  6. Set up apache on your blog server to serve static content from wherever you want your blog files to live.

  7. Now copy over the static files you created with wget to their new home on the remote machine using a secure transfer method like rsync or sftp.

  8. Laugh in the face of mankind / email me about why this didn't work.

Good luck, and please let me know if you are able to follow these steps and produce a more helpful HOWTO that I can link to.

« How Not To Get Your Blog HackedScott And Scurvy »

Greatest Hits

The Alameda-Weehawken Burrito Tunnel
The story of America's most awesome infrastructure project.

Argentina on Two Steaks A Day
Eating the happiest cows in the world

Scott and Scurvy
Why did 19th century explorers forget the simple cure for scurvy?

No Evidence of Disease
A cancer story with an unfortunate complication.

Controlled Tango Into Terrain
Trying to learn how to dance in Argentina

Dabblers and Blowhards
Calling out Paul Graham for a silly essay about painting

Attacked By Thugs
Warsaw police hijinks

Dating Without Kundera
Practical alternatives to the Slavic Dave Matthews

A Rocket To Nowhere
A Space Shuttle rant

Best Practices For Time Travelers
The story of John Titor, visitor from the future

100 Years Of Turbulence
The Wright Brothers and the harmful effects of patent law

Every Damn Thing

2020 Mar Apr Jun Aug Sep Oct
2019 May Jun Jul Aug Dec
2018 Oct Nov Dec
2017 Feb Sep
2016 May Oct
2015 May Jul Nov
2014 Jul Aug
2013 Feb Dec
2012 Feb Sep Nov Dec
2011 Aug
2010 Mar May Jun Jul
2009 Jan Feb Mar Apr May Jun Jul Aug Sep
2008 Jan Apr May Aug Nov
2007 Jan Mar Apr May Jul Dec
2006 Feb Mar Apr May Jun Jul Aug Sep Oct Nov
2005 Jan Feb Mar Apr Jul Aug Sep Oct Nov Dec
2004 Jan Feb Mar Apr May Jun Jul Aug Oct Nov Dec
2003 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2002 May Jun Jul Aug Sep Oct Nov Dec

Your Host

Maciej Cegłowski


Please ask permission before reprinting full-text posts or I will crush you.