Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deactivate certain Wordpress plugins when running on the development/staging domain
<?php
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$plugins = array(
'wordpress-seo/wp-seo.php',
'broken-link-checker/broken-link-checker.php'
);
if ( strpos(get_site_url(), 'devserver.com') !== false ) {
deactivate_plugins( $plugins );
}
else {
activate_plugins( $plugins );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.