how-to-hide-plugin-in-wordpress-dashboard

How to hide plugin in WordPress Dashboard

  • June 14, 2022

Today We gonna learn how to hide plugin in WordPress dashboard using custom snippet without any third party plugin.

/**
 * @snippet       hide plugin in wordpress dashboard
 * @author        Deep Prakash Goyal
 * @website       https://wpexpertdeep.com/
 */

add_action('pre_current_active_plugins', 'hide_plugin_from_wp_admin');

function hide_plugin_from_wp_admin() {
	global $wp_list_table;
	$hidearr = array('wpc-grouped-product/wpc-grouped-product.php','user-role-editor/user-role-editor.php' );
	$myplugins = $wp_list_table->items;
	
	foreach ($myplugins as $key => $val) {
		if (in_array($key,$hidearr)) {
		unset($wp_list_table->items[$key]);
		}
	}
}

Related Post

Fix-Images-and-Broken-Links-by-Updating-Paths-in-WordPress

Fix Images and Broken Links by Updating Paths in WordPress

Today we will learn how to fix broken images link issue in WordPress, after migrating site from local server to live server or (one domain to another). This is a very common issue. The simple […]

Insert post programmatically in WordPress

Insert post programmatically in WordPress

Today we are gonna learn how to insert post in database programmatically. The function we are going to use is wp_insert_post() For creating a post first you need to create a post array, below is […]

Hide product category or product on shop page

Hide product category or product on shop page

Hello Guys today we gonna learn how can we hide specific product category, specific product on shop page. We are going to do this with the help of code snippets. You can directly add these […]