A quick reference for the execution order of WordPress’ core hooks

I can’t tell you how many times I’ve had to look back and establish the process in my mind when building plugins or themes. I’ve done it so many times that you’d think I’d just remember it but I don’t — I always have to go spend a few minutes reminding myself. So, here’s a very quick reference for me (and maybe you!) to look back on when in need…

plugins_loaded hook fires

setup_theme hook fires

The theme’s functions.php file is included in wp-settings.php. If using a child theme, the child theme is loaded first.

after_setup_theme hook fires

init hook fires

wp_loaded hook fires

The wp() function is invoked in wp-blog-header.php

wp hook fires

The wp-includes/template-loader.php file is included in wp-blog-header.php

template_redirect hook fires

Need a website? Let's talk.

From website design & SEO through to custom WordPress plugin development. I transform ideas into dynamic, engaging, and high-performing solutions.
Subscribe to get the latest insights & updates in the world of web and how it impacts your business and website.
© 2024 Phil Kurth  |  All rights reserved.