Hide a WordPress plug-in in the plug-in list

WordPress two 1.2K Reading mode

WordPress

If you don't want customers to see the customized plug-ins displayed in the plug-in list, this tutorial will show you how to easily hide a WordPress plug-in from the plug-in list. The plug-in is still working, but will not appear in the plug-in list.

Add the following code snippet to the functions.php file of your current theme:

  1. function  hide_plugin_trickspanda() {
  2.    global   $wp_list_table ;
  3.    $hidearr  =  array ('plugin-directory/plugin-file.php');
  4.    $myplugins  =  $wp_list_table ->items;
  5.    foreach  ( $myplugins   as   $key  =>  $val ) {
  6.      if  (in_array( $key , $hidearr )) {
  7.       unset( $wp_list_table ->items[ $key ]);
  8.     }
  9.   }
  10. }
  11.  
  12. add_action('pre_current_active_plugins', 'hide_plugin_trickspanda');

Replace plugin-directory/plugin-file.php in the above code as the directory and file name of your plug-in.

Original text: How To Hide A WordPress Plugin From Plugin List

Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!

 weinxin
My Wechat
Copyright Notice
Please indicate the source and link of the original article reprinted on this site. Thank you for your cooperation!
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 
 Robin
five hundred and ninety-eight million eight hundred and forty-five thousand and six
Comments two    Visitors two
    •  good thing
      good thing three

      Code for doing bad things

      •  Shenzhen Website Company
        Shenzhen Website Company one

        Hello, Brother Bird, if you want to hide in batches, is there a good way to provide

       anonymous

      Comment

      Anonymous netizens
       :?:  :razz:  :sad:  :evil:  :!:  :smile:  :oops:  :grin:  :eek:  :shock:  :???:  :cool:  :lol:  :mad:  :twisted:  :roll:  :wink:  :idea:  :arrow:  :neutral:  :cry:  :mrgreen:

      Drag the slider to complete validation