Magento: Check If a Module Is Enabled Programmatically

Magento: Check If a Module Is Enabled Programmatically

Magento check module enabled status programmatically with isModuleEnabled(), or by reading the module's config node — one-line examples.

Magento check module status progarmatically

Magento check module status progarmatically: Magento has function to check if module is enabled or not

The functions isModuleEnabled and another is to check it node status

<?php

$moduleName = 'Mage_Core';
if (Mage::helper('core')->isModuleEnabled($moduleName)) {
  echo "Module is enabled.";
} else {
  echo "Module is disabled.";
}

?>
<?php 

$moduleName = 'Mage_Core'; 
$isActive = Mage::getConfig()->getNode('modules/' . $moduleName . '/active');
if ($isActive && in_array((string)$isActive, array('true', '1'))) {
  echo "Module is enabled.";
} else {
  echo "Module is disabled.";
}
?>

Still on Magento 1? This tutorial is for Magento 1.x, which reached end of life in June 2020 and no longer receives security patches. Our team migrates Magento 1 stores to Magento 2, Mage-OS or Adobe Commerce with your SEO and data intact — see our Magento development services.

Further reading: OpenMage, the community-maintained Magento 1 fork. Need a hand? Our Magento development team can help.

Need a hand?

Stuck on a build?
Let's solve it together.

Our engineers fix, upgrade and scale Magento, WordPress and modern stacks every day.