Skip to content

Instantly share code, notes, and snippets.

@ControlledChaos
Last active October 2, 2019 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ControlledChaos/c2d659ebf1824296f636f9d9c2a2fbba to your computer and use it in GitHub Desktop.
Save ControlledChaos/c2d659ebf1824296f636f9d9c2a2fbba to your computer and use it in GitHub Desktop.
Remove plugin entries from the list on the WordPress Plugins page.

Remove Plugin Entries

WordPress Snippet

<?php
function ccd_remove_plugin_entries( $plugins ) {
// Get plugin page URLs from the activate/deactivate links
$hidden = array(
'jetpack/jetpack.php',
'beaver-builder/fl-builder.php'
);
if ( isset( $_GET['showall'] ) && $_GET['showall'] == '1' ) {
return $plugins;
}
foreach ( $hidden as $filename ) {
unset( $plugins[ $filename ] );
}
return $plugins;
}
add_filter( 'all_plugins', 'ccd_remove_plugin_entries' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment