<p>PHP</p>

<pre><code>\Craft::$app-&gt;plugins-&gt;isPluginInstalled('plugin-handle')
</code></pre>

<p>Twig</p>

<pre><code>{% set installed = craft.app.plugins.isPluginInstalled('plugin-handle') %}
</code></pre>

<p>There is also a <code>isPluginDisabled</code> and a <code>isPluginEnabled</code> function.
Here is a class reference <a href="https://docs.craftcms.com/api/v3/craft-services-plugins.html#isPluginInstalled()-detail" rel="noreferrer">craft\services\Plugins</a></p>

CC BY-SA 3.0
2017-12-29T17:48:26.997Z
I think that has to be a record for the fastest correct answer of all time :) Thank you Robin, that's perfect.
Mark Notton
CC BY-SA 4.0
2020-03-26T20:43:43.933Z
Any tips on how to determine a plugin's handle?
Henry
CC BY-SA 4.0
2020-12-24T18:48:57.853Z
@Henry the plugins table in the database has a `handle` column
Marion Newlevant
CC BY-SA 3.0
2017-12-29T17:37:15.590Z
2017-12-29T17:37:15.590Z
Robin Schambach
<p>In <a href="https://craftcms.stackexchange.com/questions/10632/how-can-i-check-if-a-plugin-is-installed-and-enabled">a question I asked</a> a few years ago, it was very simple to perform a check on wether a plugin was installed or not. </p>

<p>As of Craft 3, the same methods don't seem to work. The likes of this always returns <code>true</code>: </p>

<pre><code>{{ craft.myPlugin is defined ? 'Installed' : 'Not Installed' }}
</code></pre>

<p>Is there another way to determine if a specific plugin is installed and enabled?</p>

<plugins><craft3>
How can I check if a plugin is installed and enabled, in Craft 3?
# How can I check if a plugin is installed and enabled, in Craft 3?

(Asked by: username_0 on 2017-12-29)

In a question I asked a few years ago, it was very simple to perform a check on wether a plugin was installed or not. 
As of Craft 3, the same methods don't seem to work. The likes of this always returns true: 
{{ craft.myPlugin is defined ? 'Installed' : 'Not Installed' }}

Is there another way to determine if a specific plugin is installed and enabled?

**Tags:** plugins, craft3


---

## 1 answers

### Answer by username_1 on 2017-12-29. Score: 6 | Accepted answer

PHP
\Craft::$app->plugins->isPluginInstalled('plugin-handle')

Twig
{% set installed = craft.app.plugins.isPluginInstalled('plugin-handle') %}

There is also a isPluginDisabled and a isPluginEnabled function.
Here is a class reference craft\services\Plugins

> **Comments:**
> **username_0**: I think that has to be a record for the fastest correct answer of all time :) Thank you Robin, that's perfect.  
> **username_2**: Any tips on how to determine a plugin's handle?  
> **username_3**: @username_2 the plugins table in the database has a `handle` column  

---

