Skip to content

Instantly share code, notes, and snippets.

@gorobey
Forked from joffff/wordpress_disable_plugin.php
Created September 15, 2022 09:46
Show Gist options
  • Save gorobey/202963ae15616b1c8ba09b5576b3e66b to your computer and use it in GitHub Desktop.
Save gorobey/202963ae15616b1c8ba09b5576b3e66b to your computer and use it in GitHub Desktop.
Disable WordPress plugin on specific page
<?php
add_filter( 'option_active_plugins', 'disable_plugins' );
function disable_plugins($plugins){
$key = array_search( 'wordpress-seo/wp-seo.php' , $plugins ); //Plugin path within /wp-content/plugins/
if ( false !== $key ) unset( $plugins[$key] );
return $plugins;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment