// Disable Plugin Edit/Deactivation from WordPress Admin Panel add_filter( 'plugin_action_links', 'disable_plugin_deactivation', 10, 4 ); function disable_plugin_deactivation( $actions, $plugin_file, $plugin_data, $context ) { // Remove edit link for all if ( array_key_exists( 'edit', $actions ) ) unset( $actions['edit'] ); // Remove deactivate link for crucial plugins if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array( 'facebook-open-graph-meta-in-wordpress/fbogmeta.php', 'wp-pagenavi/wp-pagenavi.php' ))) unset( $actions['deactivate'] ); return $actions; }
you need to change the array of $plugin_file where you see the list of specified plugins. The path of the file is relative to /wp-content/plugins/. So in the example above ‘facebook-open-graph-meta-in wordpress/fbogmeta.php’ is a file located in the folder facebook-open-graph-meta-in-wordpress which is located inside the plugins folder. You can change the list to add as many plugins as you want.