How do you reset WordPress sites?
And, what exactly do I mean by ‘reset’? It means primarily two things in this post’s context –
- Go back in time to ‘vanilla’ WordPress with the same version
- Ensure any customisation you have made is rolled back
If you are like me, reset is not something you would often do. But, when you do get to that problem you may simply shrug and install WordPress anew.
This works beautifully.
WordPress is popular for its one-click installation process and we leverage that to our heart’s content.
However, if you are a designer or developer who wants to go back to your WordPress default installation to try out your designs, scripts and what not, re-installation consumes valuable time.
What do developers do to reset WordPress?
Developers have the option of –
- Using configuration management tools like Chef, Puppet etc.
- Use automation tools like Gulp
- Use Docker, Ansible or similar to create configurations and reset when required
- Or, just revert to the freaking backup
What mortals do to reset WordPress?
I, being a pseudo-developer, make use of God, er.. community-given, tools to create magic.
- The first option is no magic.
I am used to backup database, and files. Reset selectively depending on what I need. File backup with be through Git or copying the entire site folder.
A database backup will be through Database/SQL utilities. You can use vendor-supplied tools like MySQL Admin. This just works.
- Use plugins like Duplicator to clone the ‘vanilla’ WordPress site. Store the backups in an easy-to-reach place, and you can use the same plugin route to revert everything to the origin.
- Use plugins like WP-Reset to just click and get the job done
So, do I hear back the question ‘which one is the best’?
Simple answer: all of them. Or, to put it more succinctly – ‘it depends on your use case’.
When to use what?
I typically avoid plugins in my production site.
Just because I can.
And partly because a lot of plugins happen to be poorly written and can cause performance issues.
Since resetting WP is not a ‘user’ function, I can safely use plugins like Duplicator or WP Reset in the development environment. This speeds up the time for resetting the site.
The problem is – I don’t quite take backups on time. I am what they call ‘lazy’.
I lied, there is a ‘best’ option
And that is manually taking backups IMO. WordPress is reverted through files on Git (which are version controlled), and restoring the database to its pristine glory by running SQLs.
This is the best option since you use Git to not only track the default version, but also the incremental changes. This makes it really good to go back in time to a specific version as well.
Databases are backed-up ad-hoc, or on a periodic basis to complement the file backups.
You have better control over what to use and can come out of any tricky situation that development process throws at you.