Skip to content

Instantly share code, notes, and snippets.

@advancedwpuser
Created May 16, 2015 17:02
Show Gist options
  • Save advancedwpuser/510cd3dd53943938ccf2 to your computer and use it in GitHub Desktop.
Save advancedwpuser/510cd3dd53943938ccf2 to your computer and use it in GitHub Desktop.
Dynamically Enable/Disable Search Engines when using MigrateDB Pro
/*
* Migrating your DB with Migrate DB Pro
* your "Disable Search Engines" setting
* can get pushed to your live site
* This is how you can automate that
* Ref: https://deliciousbrains.com/tweaking-wp-migrate-db-pro-actions-filters/
* AWP Link: https://www.facebook.com/groups/advancedwp/permalink/951660888229459/
* Care of Chris Perryman www.revelationconcept.com
*/
add_filter('wpmdb_preserved_options', function($preserved_options) {
$preserved_options = array_merge($preserved_options, array('blog_public')); // don't tell Google it can index test site!
return array_unique($preserved_options);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment