How To Convert Your WordPress Blog To A Static Site

Recently, I found this old question on WordPress StackExchange:

I am starting a new WordPress blog, and no longer updating an old one. [...] How can I lock the installation of WordPress down so I don’t need to maintain it? I have seen someone suggest making a static version, which sounds like a lot of work.

The top-rated answer is very good, but overly complicated. It involves custom code and .htaccess modification. I think I can offer a simpler solution. Here’s how you can turn your blog into a static site:

  1. Make a backup. Just in case.
  2. Disable comments and any other dynamic features your blog may have, e.g. contact forms.
  3. Install WP-SuperCache and set the cache expiry time to 604800 seconds (= one week).
  4. Fire up Xenu’s Link Sleuth and tell it to crawl your entire site. This will make WP-SuperCache generate static HTML files for all of your pages.
  5. Delete all .php files and drop the WordPress database.

With all PHP scripts deleted, “expired” cache entries will never be removed, so the server will keep serving the same cached pages forever. Congratulations, your site now static :)

Alas, the aforementioned SE thread is rather old, so if I posted my answer there, no-one would probably ever see it.

Related posts :

13 Responses to “How To Convert Your WordPress Blog To A Static Site”

  1. asf says:

    That SE thread’s top answer only has 4 upvotes and it has not been marked as the answer so if you post your answer, the owner will get a notice and might mark it as the answer and bring it to the top. And the point of SE is to replace EE so google will bring traffic there and they will see your answer even if it is a old thread

  2. Ozh says:

    Very neat stuff. Might want to be a bit more accurate about files to delete though, or is there a missing step? (moving all files from within wp-content/cache/… up a few directories)

  3. White Shadow says:

    You can leave them where they are. Manually removing WP-SuperCache doesn’t disable its .htaccess rules, so Apache will still be able to find and serve the cached files correctly.

  4. MK Safi says:

    WP Super Cache has a feature called Preload Cache. I think this feature generates HTML files for all pages — so why the need for Xenu’s Link Sleuth?

  5. White Shadow says:

    As far as I know, it only preloads posts. You need the crawler to make it cache all the other pages, like category archives.

  6. [...] Ref Page Link Question: I am starting a new WordPress blog, and no longer updating an old one. [...] How can I lock the installation of WordPress down so I don’t need to maintain it? I have seen someone suggest making a static version, which sounds like a lot of work. [...]

  7. Jocuri says:

    Thanks for a very long time I searched for this tutorial

  8. I did not know that static sites to someone else needed

  9. converter says:

    This conversion helps your search egine result if you want to blog have a higher position in ranking

  10. MK Safi says:

    Hey, check out this plugin: http://wordpress.org/extend/plugins/static-html-output-plugin/

    Do you think it’s a convenient alternative?

  11. urania says:

    I really wanted to type a brief note so as to say thanks to you for those precious hints you are sharing on this site. You may try ipad transfer. http://www.ipad-transfer.com/ipad-to-mac.html

  12. I think I can offer a simpler solution.
    ____________
    Allen

  13. Iosif says:

    Seems to be the best way to convert WP to static HTML. I will give it a try on a few of my sites.

Leave a Reply