Print

ManageWP Disconnects After Migrating From Staging Site

If you use ManageWP to manage both the staging and live site, each time the staging site is pushed to live site it disconnects the live site from ManageWP.

To prevent that you need to tell WP Staging do not overwrite the ManageWP settings in the database. To do so just use the code below and copy it to the functions.php file of your theme. You find it in
wp-content/themes/THEME/functions.php

function wpstg_push_options_excl($options){
$moreOptions = array(
'mwp_service_key',
'mwp_openssl_parameters',
'mwp_incremental_update_active',
'mwp_public_keys',
'mwp_new_communication_established',
'mwp_service_key',
'mwp_core_autoupdate',
'mwp_container_parameters',
'mwp_container_site_parameters',
'mwp_maintenace_mode',
'mwp_worker_configuration',
'mwp_communication_key',
'mwp_worker_brand',
'mwp_potential_key',
'mwp_potential_key_time',
);      
return array_merge($options, $moreOptions ); 
}
add_filter('wpstg_preserved_options','wpstg_push_options_excl');

You also need to exclude the ManageWP worker plugin from being copied. You can either exclude it manually before your push the staging site or you can add the following code into your functions.php as well:

function wpstg_exclude_folders_custom($args){ 
$folders = array('worker');      
return array_merge($args, $folders); 
} 
add_filter('wpstg_push_excl_folders_custom', 'wpstg_exclude_folders_custom');