Say that you are developing a backup plugin. This backup plugin needs to back up the entire WordPress installation. If on a single site, this is a given. But with multisite, where one can have hundreds of sites, the backup plugin needs to be installed for “all” sites.
Another example would be an update manager plugin. On a single site, the plugin can be activated with no issues as updates are managed at the admin level. On multisite, however, you’d want the plugin to be active for the entire network since updates are handled at the network level.
Fortunately, making a plugin that can only be network-activated (Network-only) when on a multisite network is pretty straightforward. You just need to include a “Network” header to your plugin. For example, let’s take a look at a plugin called Easy Updates Manager.
I’ve worked on this plugin in the past and it was specifically designed to only work when network-activated on multisite.
Here are its plugin headers:
Plugin Name: Easy Updates Manager
Plugin URI: https://easyupdatesmanager.com
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
Author: Easy Updates Manager Team
Update URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
Author URI: https://easyupdatesmanager.com
Contributors: kidsguide, ronalfy
Text Domain: stops-core-theme-and-plugin-updates
Domain Path: /languages
Code language: PHP (php)
I’ve highlighted the “Network” header in the code snippet. Simply add “Network: true” to your plugin header and your plugin will now have to be network-activated when on a network.
When viewing the Plugins screen on a site within the network, the plugin will show that it can only be activated network only.
In this brief tutorial, I explained why you would want to make a plugin network-only and how to make a plugin so that it can only be network-activated on a network.
For more on Multisite, please check out my guide on multisite from a plugin author’s perspective.