Skip to main content
When you push changes between a live site and its staging copy (or vice versa), the MainWP connection often breaks. This happens because the synchronization process copies the encryption key that MainWP uses to identify the connection.

What You’ll Learn

  • Why staging sync breaks the MainWP connection
  • How to exclude the MainWP key from sync operations
  • How to reconnect after syncing

Why This Happens

MainWP uses OpenSSL encryption to secure communication between your Dashboard and child sites. When a child site connects to your Dashboard:
  1. The Dashboard generates a unique public key
  2. This key is stored in the child site’s database as mainwp_child_pubkey (in the wp_options table)
  3. All subsequent communication uses this key for encryption
When you sync databases between live and staging, the staging plugin copies the mainwp_child_pubkey value from one site to the other. This overwrites the correct key, and the connection breaks because the key no longer matches what the Dashboard expects.

Solution 1: Exclude the Key from Sync

The best approach is to configure your staging plugin to exclude the MainWP key from synchronization.

WP Staging

1

Open settings

Navigate to WP Staging > Settings.
2

Go to Advanced tab

Select the Advanced tab.
3

Add exclusion

In the database exclusion section, add:
mainwp_child_pubkey
4

Save settings

Save your settings before the next push/pull operation.

Duplicator Pro

1

Create package

During package creation, go to the Database tab.
2

Find options section

Under Tables, locate the options section.
3

Add exclusion filter

Add an exclusion filter for option_name = 'mainwp_child_pubkey'.

WP Migrate

1

Open migration settings

In migration settings, go to Advanced Options.
2

Add exclusion

Add to the “Exclude Post Types” or custom SQL section:
option_name = 'mainwp_child_pubkey'

Other Staging Tools

Check your staging tool’s documentation for database field exclusions. The goal is to prevent mainwp_child_pubkey from being copied during sync operations.

Solution 2: Reconnect After Sync

If your staging tool doesn’t support exclusions, reconnect the site after each sync:
1

Access the staged site

Log in to the staged site’s wp-admin directly (not through MainWP).
2

Navigate to Child settings

Go to Settings > MainWP Child.
3

Deactivate the plugin

Click Deactivate (or deactivate from the Plugins page).
4

Reactivate the plugin

Reactivate the MainWP Child plugin.
5

Reconnect from Dashboard

Return to your MainWP Dashboard and reconnect the child site using the same process as initial setup.

Prevention Tips

  • Configure exclusions before your first staging sync
  • Document which sites have staging environments
  • Consider using separate MainWP Dashboards for staging networks if you manage many staging sites
  • Test the exclusion by syncing and verifying the connection remains intact

Self-Check Checklist

  • Staging plugin configured to exclude mainwp_child_pubkey
  • Test sync completed without breaking connection
  • Documentation updated for your staging workflow