Forked from subharanjanm/deactivate-plugins-wpe-staging.php
Last active
April 25, 2023 18:40
-
-
Save JayHoltslander/54bafb8460718029087bc762f3ea7942 to your computer and use it in GitHub Desktop.
Deactivate certain Wordpress plugins when running on the development/staging domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); | |
} |
Where would you put this? functions.php?
I use it as a plugin in the wp-content/mu-plugins folder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where would you put this? functions.php?