Phil Kurth

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

Last updated • 18 February 2020

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

Got a project in mind?
Let's talk.

Every project starts with a conversation about what you need. You hear back the same or next business day. If I'm not the right fit, I'll say so. If I am, you get a fixed quote before any work starts.

Phil Kurth, web designer and developer in Geelong