How to Backup and Restore WordPress Theme Options

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.

shapeSpace Backup/Restore Example

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:

Backup Themes Options FileWhen something happens that you wish to restore your theme to a previous setting, use the “Restore/Import” option to select, upload, and apply the backup settings:

Restore/Import Theme

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_options with any option that already exists in the WP database, like widget_recent-comments or active_plugin.

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

Images from Digging Into WordPress – Backup and Restore Theme Options

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s