Prevent backup/Upload via wp-config

I frequently pull the production database over to a staging or local site, and I often see that when I do updates on those, the automatic backup feature is still engaged.

I’d like to be able to add code somewhere like wp-config to override settings to prevent a staging site from being backed up and uploaded to remote storage.

twitterlinkedinFacebook

4 Comments

  1. udadmin

    Hi Brian,

    You can do this using the updraftplus_boot_backup filter. Block a backup with this fragment:

    add_filter(‘updraftplus_boot_backup’, ‘__return_false’);

    David

  2. Andrew

    David, I think it would be better to be able to add a constant in wp-config.php, since filters can go in a lot of different places, which can lead to confusion and mistakes. For example, if they’re in the theme’s functions.php, and a dev site is changing themes, this setting could be lost. Similarly, we shouldn’t’ have to create a custom plugin for this.

    How about a simple constant in wp-config.php, like this?

    define (‘DISABLE_UPDRAFTPLUS_BACKUPS’, true );

  3. Brian

    Could I maybe use the updraftplus_boot_backup in an mu-plugin? that would be the next best thing to having it in wp-config

  4. Brian

    Also, does this filter prevent all backups from happening or just scheduled ones?

Submit a Comment