The most used Wordpress hooks

The most used Wordpress hooks

Created:28 Nov 2016 20:53:05 , in  Web development

Below is a list of the most often used hooks (sorted by the number of callbacks attached ) on a vanilla installation of WordPress (v.4.6.1) with twentysixteen theme loaded.

On such a setup, in total I found 261 hooks, something was attached to. As seen in the list, the most used hooks were: wp_head (24 callbacks attached), the_content(10 callbacks) attached and everyone's favorite init with also 10 callbacks.

126 callbacks were attached to the 20 hooks, which comprised 27.6% of total number of executed callbacks at every request. For completeness, 456 callbacks were executed every time I refreshed index page.

No wonder Wordress feels slow without some initial optimization.

WordPress hooks array

If you would like to count hooks and callbacks by yourself, they are stored in wp_filter array and can be accessed through $GLOBALS['wp_filter'].

Here is (a shortened version of ) the list of the most used Wordpress hooks and callbacks attached to them.


wp_head:24
the_content:10
init:10
embed_head:8
wp_enqueue_scripts:7
admin_init:7
comment_text:7
template_redirect:6
the_excerpt:5
the_excerpt_embed:5
wp_title:4
term_description:4
transition_post_status:4
login_head:4
the_title:4
term_name:4
link_name:4
link_notes:3
pre_post_guid:3
pre_link_rss:3

This post was updated on 04 May 2017 23:11:28

Tags:  wordpress 


Author, Copyright and citation

Author

Sylwester Wojnowski

Author of the above article, Sylwester Wojnowski, is sWWW admin and owner.He enjoys doing Maths and studying algorithms, writing code in scripting and command languages, Thrash Metal music and playing electric guitar.

Copyrights

©Copyright, 2019 Sylwester Wojnowski. This article may not be reproduced or published as a whole or in parts without permission from the author. If you share it, please give author credit and do not remove embedded links.

Computer code, if present in the article, is excluded from the above and licensed under GPLv3.

Citation

Cite this article as:

Wojnowski, Sylwester. "The most used Wordpress hooks." From sWWW - Code For The Web . https://wojnowski.net.pl//main/index/the-most-used-wordpress-hooks