Read on if you are an advanced WordPress user.
You set up your WordPress Theme just the way you want with Theme options, all set, now you need to backup or restore. What do you do?
There is a plug-n-play snippet to create if your theme isn’t set up for backup and restore. The snippet called Backup/Restore Theme Options that can be seen in action if you look at the ShapeSpace Theme.
The Basics of the Backup and Restore Snippet
You use a PHP class to create a “Backup/Restore Options” page in the WP Admin. This will add code that will change the Appearance menu to contain a “Backup Options” link leading to the Backup/Restore Options page. From there you can backup or export at your convenience as shown below:
Think you may need this, you need to go to the site to get the full code from Backup and Restore Theme Options on Images from Digging Into WordPress, Backup and Restore Theme Options – Digging into WordPress.
The code is credited and based on a technique of Gantry Export an Import Options.
When you include this code in your theme’s template, only edit the instance listed as
shapeSpace_options with the name of your theme. The instructions state:
If your theme doesn’t have its own options, you can still see it work by replacing
shapeSpace_optionswith any option that already exists in the WP database, like
Once you add the code it should work right away for you but it has been only tested with a handful of themes. You can do further customization of the code but none is necessary. Some WordPress Themes will have their own options so this is something to consider if the theme you have chosen does not have this feature.
For More Information
- Backup and Restore Theme Options – Digging Into WordPress By Jeff Starr
- shapeSpace WordPress Theme – Perishable Press
- Gantry Export and Import Options WordPress Plugin