Your Plugins screen says “This plugin cannot be activated because required plugins are missing or inactive,” or WordPress will not let you deactivate a parent plugin. This article explains why and how to fix it, for site admins and agency developers. Since WordPress 6.5, a plugin can name other plugins it needs in a Requires Plugins header, and core enforces that list. Activation is blocked until every required plugin is installed and active, and the parent loses its Deactivate and Delete links while plugins that need it are around. Most failures come from three causes: plugins activated in the wrong order, a required plugin installed under a different folder name, or a required plugin placed in mu-plugins. Each one has a clean fix that leaves core untouched.
What you’ll accomplish
- Read which plugins an add-on requires, from the Plugins screen and from WP-CLI (the WordPress command-line tool).
- Activate a parent and its add-ons in an order that works in the admin, in WP-CLI and in deployment scripts.
- Fix a premium or renamed plugin that core cannot match to its WordPress.org slug.
- Deactivate or remove a parent plugin safely when you need to.
- Recognise circular requirements and know what to ask the plugin author for.
Prerequisites
- WordPress 6.5 or later. Older versions ignore the
Requires Pluginsheader completely. Check withwp core versionor under Dashboard > Updates. - An administrator account with the
activate_pluginscapability. On multisite, a network administrator for network-activated plugins. - Shell access for the WP-CLI steps: SSH, or Terminal in cPanel (under Advanced) if your host enables it. WP-CLI 2.12, the current stable release, is enough for every command here.
- A recent backup, or at least a database export, before you rename plugin folders.
How it works
A plugin declares its needs in the comment block of its main PHP file:
/**
* Plugin Name: Shop Reports
* Requires Plugins: woocommerce, shop-invoices
*/
The value is a comma-separated list of slugs, the short names used in WordPress.org addresses such as wordpress.org/plugins/woocommerce/. Core keeps only slugs made of lowercase letters, digits and single hyphens. Anything else is dropped without a warning, so a typo or a capital letter means the requirement silently disappears.
Core then looks for each slug among installed plugins. It does not read plugin names or text domains. It compares the slug with the plugin’s folder name in wp-content/plugins/, or with the file name minus .php for a single-file plugin. Only regular plugins take part. Must-use plugins (files in wp-content/mu-plugins/ that load on every request without activation) are never counted. A must-use copy of WooCommerce therefore leaves woocommerce listed as missing.
With that list in hand, core enforces four rules:
- Activation is blocked.
activate_plugin(), the function behind the Activate link, WP-CLI and most deployment tools, refuses to run while a required plugin is missing or inactive. The error reads “Shop Reports requires 2 plugins to be installed and activated: Shop Invoices, WooCommerce.” - The Plugins screen shows the links. An add-on shows a Requires: line. A parent shows Required by: with the names of its add-ons. Under it, a note warns that the parent “cannot be deactivated or deleted until the plugins that require it are deactivated or deleted”.
- The parent is protected in the admin only. While any plugin that requires it is active, the parent’s Deactivate action is plain text, not a link. While any plugin that requires it is installed, active or not, Delete is plain text too. Its bulk-action checkbox is disabled.
- Nothing is deactivated for you. If the parent disappears or is deactivated outside the Plugins screen, core leaves the add-ons active. Their row then says “This plugin is active but may not function correctly because required plugins are missing or inactive.”
The amber banner at the top appears when at least one required plugin is not installed at all. A required plugin shown by its raw slug, like pdf-toolkit above, is not installed under that folder name and has no WordPress.org listing core could take a name from.
Step-by-step
-
List what the add-on requires. On the Plugins screen, read the Requires: line under the add-on. In a shell, ask WP-CLI for the header value. Run these from the WordPress root, the folder that holds
wp-config.php.wp plugin get shop-reports --field=requires_pluginsExample output:
woocommerce, shop-invoicesAn empty line means the add-on declares no dependencies, so the activation problem has another cause, such as a PHP error. To see every declaration on the site at once, search the main plugin files:
grep -n "Requires Plugins" wp-content/plugins/*/*.phpExample output:
wp-content/plugins/shop-invoices/shop-invoices.php:5: * Requires Plugins: woocommerce wp-content/plugins/shop-reports/shop-reports.php:5: * Requires Plugins: woocommerce, shop-invoices -
Compare each slug with the installed folder names. The
namecolumn in WP-CLI is the folder name, which is what core matches against.wp plugin list --fields=name,status,versionExample output:
+-------------------+----------+---------+ | name | status | version | +-------------------+----------+---------+ | shop-invoices | inactive | 1.4.0 | | shop-reports | inactive | 2.1.3 | | woocommerce-9.4.2 | active | 9.4.2 | +-------------------+----------+---------+Every required slug must appear exactly in that column. Here,
woocommerceis required but the folder iswoocommerce-9.4.2, so core treats WooCommerce as missing even though it is active. Go to step 4. If a required plugin showsmust-usein the status column, go to step 5. If every slug matches and is only inactive, go to step 3. -
Activate parents before add-ons. Pass plugins to
wp plugin activatein dependency order. WP-CLI processes them left to right, so each parent is already active when its add-on’s turn comes.wp plugin activate woocommerce shop-invoices shop-reportsExample output:
Plugin 'woocommerce' activated. Plugin 'shop-invoices' activated. Plugin 'shop-reports' activated. Success: Activated 3 of 3 plugins.If an add-on comes first, you get a warning such as
Warning: Failed to activate plugin. Shop Invoices requires 1 plugin to be installed and activated: WooCommerce. .and anError: Only activated 1 of 2 plugins.line. The command then exits with status 1, which stops most deployment pipelines. Be careful withwp plugin activate --all: it works through plugins in alphabetical folder order, so an add-on namedacme-woo-syncis tried beforewoocommerceand fails. In scripts, list plugins explicitly, one dependency level after another. -
Fix a folder-name mismatch. Premium plugins downloaded from a vendor site often unpack into a folder with a version number or a different name. The cleanest fix is to rename the folder to the slug the add-on expects. Deactivate the add-ons first, then the parent, rename, and reactivate in order:
wp plugin deactivate shop-reports shop-invoices woocommerce-9.4.2 mv wp-content/plugins/woocommerce-9.4.2 wp-content/plugins/woocommerce wp plugin activate woocommerce shop-invoices shop-reportsThe success signal is
Success: Activated 3 of 3 plugins.Plugin settings live in the database, so they survive the rename. If you cannot rename the folder, for example because a vendor’s updater depends on it, map the slug with thewp_plugin_dependencies_slugfilter. Core documents this filter for switching between free and premium slugs. Save this aswp-content/mu-plugins/dependency-slug-map.php:<?php /** * Plugin Name: Dependency Slug Map * Description: Maps WordPress.org slugs in Requires Plugins headers to the folder names used on this site. */ add_filter( 'wp_plugin_dependencies_slug', function ( $slug ) { $map = array( 'woocommerce' => 'woocommerce-9.4.2', ); return $map[ $slug ] ?? $slug; } );Check it with
php -l wp-content/mu-plugins/dependency-slug-map.php, which should printNo syntax errors detected. Keep it inmu-plugins: a must-use file always loads, so the mapping stays in place while you deactivate, swap or update the regular plugins involved. -
Move a required plugin out of mu-plugins. A plugin that other plugins require must live in
wp-content/plugins/under its WordPress.org slug and be activated normally. Move the folder back, remove any loader file you added inmu-plugins, and activate the parent before its add-ons as in step 3. Must-use status cannot satisfy a dependency, and no filter changes that. -
Deactivate or remove a parent safely. In the admin, deactivate every add-on listed on the parent’s Required by: line first, and delete them too if you want to delete the parent. WP-CLI does not apply the admin protection.
wp plugin deactivate woocommercesucceeds even while add-ons depend on it, and the add-ons stay active. Their code then runs without the parent, and a poorly guarded add-on can stop the site with a fatal PHP error. From the shell, always deactivate add-ons in the same command, ahead of the parent:wp plugin deactivate shop-reports shop-invoices woocommerceExample output ends with
Success: Deactivated 3 of 3 plugins.
Validate it works
-
Reload Plugins. The amber “Some required plugins are missing or inactive.” banner is gone, and no row shows the red “missing or inactive” notice.
-
Confirm the active set from the shell:
wp plugin list --status=active --fields=name,statusEvery add-on and every slug from its Requires: line should appear with
active. -
For a deployment script, check the exit code:
wp plugin is-active shop-reports; echo $?prints0when the add-on is active and1when it is not.
Troubleshooting
- “These plugins cannot be activated because their requirements are invalid.” Two plugins require each other, directly or through a chain. The notice lists each pair as “Plugin A requires Plugin B.” Neither can be activated through the normal path, but Delete stays available for both. Send that list to the plugin authors, because only they can correct the header. Avoid working around it by returning an empty string from
wp_plugin_dependencies_slug. That drops the requirement for every plugin on the site, not only the broken pair. - The add-on activated on a staging copy but fails in production. Compare
wp plugin liston both. Staging often holds the parent under the correct folder name, while production received a vendor zip with a versioned folder. - A plugin’s Requires line ignores a dependency you can see in its header. The slug probably contains capitals, spaces or underscores, so core dropped it. Ask the author to use the exact WordPress.org slug.
- The parent cannot be deleted although its add-ons are inactive. That is expected. Delete stays blocked while any plugin that requires it is installed. Delete the add-ons first, or remove the parent with WP-CLI after you have confirmed the add-ons are no longer needed.
- The site breaks right after a parent was removed by FTP (file transfer) or a file manager. Add-ons stayed active without the parent. Put the parent back, or deactivate the add-ons with WP-CLI. If the admin will not load, follow safely deactivating a WordPress plugin from the command line.
When this is the wrong approach
If an add-on starts but shows its own “please install X” message, the add-on runs its own check, not the core header, and its documentation is the place to look. Across many cPanel accounts, keep folder names identical and push activation order from one script, as described in WordPress plugin management at scale across cPanel accounts via WHM. Never edit core files such as class-wp-plugin-dependencies.php to remove the check, because the next core update overwrites them. For the header rules from the WordPress side, see Header Requirements in the Plugin Handbook and the 6.5 introduction to plugin dependencies.
Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.