WordPress action hook

plugins_loaded

Fired by 7 WordPress plugins, running on 2M+ sites between them.

“Fires once activated plugins have loaded.”

How to use plugins_loaded

It's an action: your callback runs at that point. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'plugins_loaded', function() {
	// Your code runs here.
}, 10, 1 );

Argument names come from Starter Templates: AI-Powered Website Templates for Elementor & Gutenberg's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

7 plugins that fire plugins_loaded

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Starter Templates: AI-Powered Website Templates for Elementor & Gutenberg icon Starter Templates: AI-Powered Website Templates for Elementor & Gutenberg1+ million installs do_action( 'plugins_loaded' ) inc/classes/class-astra-sites-importer.php:1203
  2. All-In-One Security (AIOS) icon All-In-One Security (AIOS)1+ million installs do_action( 'plugins_loaded' ) classes/commands/wp-security-tfa-commands.php:20
  3. Plugin Detective icon Plugin Detective5,000+ installs do_action( 'plugins_loaded' ) troubleshoot/includes/class-settings.php:736
  4. Student Result or Employee Database icon Student Result or Employee Database900+ installs do_action( 'plugins_loaded' ) activation.php:29
  5. Bastora Security Audit icon Bastora Security Audit60+ installs do_action( 'plugins_loaded' ) includes/class-cli.php:16
  6. HRMpilot Room Manager icon HRMpilot Room ManagerFewer than 10 installs do_action( 'plugins_loaded' ) modules/booking-manager/includes/class-hrmrm-booking-frontend.php:635
  7. Wilje Online Verzendlabel icon Wilje Online VerzendlabelFewer than 10 installs do_action( 'plugins_loaded' ) wilje-verzendlabel.php:83

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.