Make WordPress static
Since I had so many WordPress sites to convert into static HTML, I decided to write a nice little bash script for it. This will take care of everything except editing the theme files to take out links to RSS, meta links, or anything else you want removed. It will basically go through the list of steps outlined in this post: Convert WP to Static HTML Part 2.
What’s nice about the script is that it grabs the database info from the wp-config.php and autmagically formats the wget command. So basically, it does the following steps for you:
- Update the database to close comments on all posts and pages. Update the database permalink structure.
- Checks for a .htaccess file and for the correct rewrite code. If it doesn’t exist it creates one. If it exists but doesn’t think the right code is in there, it will append it to the end of the file.
- It makes a backup of the database before making the changes, and then again right after.
- Reminds you to change the theme files before asking if you would like it to run the wget command.
Ideally, you’ll have edited the theme files before hand, so that you can just run this script, and it will make a static copy of your WordPress blog.
Search
Categories
Recent Comments
Recent Posts
- History’s equation
- The paper is done.
- Some more changes to the project.
- Gathering the historiography
- Getting my hands dirty
- Switching topics
- Archival Research
- The Mystery of Scholarly Articles Revealed
- The review of the historiographical essay
- Aaarg – finding an historiographical essay
- Changing plans already
- Graduate Research Paper
- Poster Session at the History of Ed
- Multiple PHP Instances With One Apache
- 40th anniversary of the moon landing