In what order does WordPress resources (e.g. templates, php files, media, plugins, widgets, enqueued scripts, and CSS) get loaded?

I am new to WordPress and there is some basic info I have been unable to find on this forum; I was wondering if someone might be able to describe the order in which various resources like templates, PHP files, media, plugins, widgets, enqueued scripts, and CSS are loaded in WordPress.

This question asks about plugins only, but it would be helpful to know about how a page is loaded, from start to finish, so learners can get an idea about the entire rendering process.

This question asks users to provide a flow chart about the load order. I am requesting three things that are different;

  1. I would like to have plugins and widgets explictly addressed.

  2. I would also like people to answer the question, and answer it using words and/or images, I am not specifically asking for a flow chart.

  3. I am also asking that respondents make an effort to avoid going into too much detail, so beginners can get a good sense of the most important parts of the loading process.

Any information is helpful, including reference links, however, those comprehensive guides are already online. The problem is that for new users, they are dense, long, and not easy to understand. I'm hoping a community member can provide an answer that gives a nice, well-rounded overview of the process, without listing every single detail that one can look up in the online guides.


2 Answers 2


First plugins are loaded, then templates.

Media is not loaded until called (afaik) from either a plugin or theme.

Widgets, enqueued scripts and CSS can be called from both plugins and templates so it depends where they are defined.


You can learn about Template Hierarchy on the developer handbook https://developer.wordpress.org/themes/basics/template-hierarchy/

Not the answer you're looking for? Browse other questions tagged or ask your own question.