Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove plugin information from the plugins page wordpress

I want to remove the information about an installed plugin from the WordPress dashboard plugins page. I have written the following code, but it doesn’t work!

please guide me?

add_filter( 'all_plugin', 'remove_plugins');

function remove_plugins($plugins)

{
 if(is_plugin_active('/woocommerce-checkout-manager/woocommerce-checkout-manager.php')) {

 unset( $plugins['woocommerce-checkout-manager.php'] );

}
 return $plugins;

}

I added this code to my template function file but it still doesn’t work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Use the filter below to delete the information of the plugin installed in WordPress and the WordPress plugins page.

Note that in the first value, put the folder and the main file of the plugin, and in the second value, only the main file of the plugin without adding the folder.

add_filter(
    'all_plugins',
    function ( $plugins ) {

        $shouldHide = ! array_key_exists( 'show_all', $_GET );

        if ( $shouldHide ) {
            $hiddenPlugins = [
                'woocommerce-checkout-manager/woocommerce-checkout-manager.php',
                'woocommerce-checkout-manager.php',
            ];

            foreach ( $hiddenPlugins as $hiddenPlugin ) {
                unset( $plugins[ $hiddenPlugin ] );
            }

        }

        return $plugins;
    }
);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading