I have been using Local for a few sites that I want to destroy and rebuild often. But I’d like to keep all the site files. As a result, I’ve begun development on a new add-on that will add a button or action (somewhere) for a site that will allow you to totally reset the DB back to the way it starts for a new Local install – but keeps the files. Not sure if I will be successful but it would be super useful for my workflows as a plugin developer testing many different versions of PHP / etc for different plugins.
Aren’t there plugins that will do this?
https://wordpress.org/plugins/wp-reset/ and probably others.
Yes but I’d like to be able to do this directly from the Local sites management section, not from within WP itself or to go into the terminal / WP-CLI.
Understood. I figured you had good reasons for not using a plugin.
Yeah what I’m hoping to do here is clear the uploads folder entirely and reset the DB + reinstall WP. Hoping it’s a quick process but I’m just getting started with my first add-on (this) for Local so it’s been a bit of learning.
Hey @sc0ttkclark happy to provide assistance or answer any questions you have about building an add-on. It would be great to get this included in the Add-ons Market! DM our twitter with your phone number and we can setup a call if you’d like
Did you finish building the “Reset Site” Addon ?
I have not started the real code yet, mostly I’ve spent time digging into the add-on structure and putting some initial code up that’s a proof of concept.