I'm developing a plugin that requires a couple of plugins from WordPress repository to work correctly.

Is it possible to download and install from WordPress repository and activate one or more plugin that my custom plugin requires automatically on plugin activation?

There is a safe and correct way to do this via PHP?


2 Answers 2


TGMPA is a useful php class to perform the required actions: http://tgmpluginactivation.com/

  • I'll try it, thank you!
    – icolumbro
    Oct 15, 2021 at 14:12
  • It (almost) works!
    – icolumbro
    Oct 16, 2021 at 12:19
  • 1
    There is a number of issues with TGMPA, and no active development for several years. Oct 17 at 10:07

In addition with Andrea Somovigo's answer, this is a list of services and open sources that might be useful:

WP2E is a service allowing developers to create and manage installation packages to deliver and maintain sets of interdependent themes and plugins.

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).

It is a Free WordPress plugin manager and bulk installation tool

This site mirrors the WordPress plugin and theme directories as a Composer repository.

This meta-plugin allows regular plugins to specify other plugins that they depend upon.

A lightweight class to add to WordPress plugins/themes to automatically install plugin dependencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.