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:- The Dashboard generates a unique public key
- This key is stored in the child site’s database as
mainwp_child_pubkey(in thewp_optionstable) - All subsequent communication uses this key for encryption
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:
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:
Other Staging Tools
Check your staging tool’s documentation for database field exclusions. The goal is to preventmainwp_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
Related Resources
- OpenSSL Keys Encryption - How MainWP encryption works
- Reconnecting Child Sites - Reconnection process
- Staging Extension - MainWP’s built-in staging solution
