WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created plugin that goes to wordpress plugin repositories. Now, I need to create another plugin (sub plugin or child plugin you may call) that require this certain plugin to be already installed and activated.

I know I can use register_activation_hook. However, how do I check using that hook? Or, maybe there's another solution exists?

share|improve this question
up vote 3 down vote accepted

There is is_plugin_active() function.

Other method is to check if functions or classes, specific to required plugin, exist. Some plugins explicitly define their own constants for this, typically with version number and/or other identifying info.

There has been some developments to make extension dependence logic more generic, such as Plugin Dependecies, but they hadn't gained widespread adoption so far.

share|improve this answer
You may also need to add the require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); before you can use is_plugin_active() – Nickiler Jan 15 '12 at 9:43
Hey @rarst, the link doesn't work any more. Is there any updated version of the link? – Mahmudur Mar 18 '13 at 4:03
@Mahmudur plugin had changed a lot since, so no newer example from it... – Rarst Mar 18 '13 at 10:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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