Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Deactivate certain Wordpress plugins when running on the development/staging domain
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$plugins = array(
if ( strpos(get_site_url(), '') !== 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.