Are you profiling your WordPress-based web application/site with xhprof? Go read my other article about how to install and configure xhprof profiler with WordPress. Even if you are already familiar with xhprof, there is a small but important problem: the profiling results are unnecessary bloated.


See what I mean?
What are these?
- ()main
- op_???
- call_user_func_array
- do_action
- etc
Is it really important for us to know that a function going by name do_action takes 800 milliseconds of a site’s loading time? What about call_user_func_array? Well, no, not even a little bit. These general WordPress/PHP functions tell us nothing valuable.
Put them on the $ignoredFunctions list
The solution is straightforward. Open the xhprof’s config.php file and look for $ignoredFunctions variable. It was commented out in my case. Uncomment it and add names of the functions you want to hide from the chart and table there. Fore example:
$ignoredFunctions = array( /** * Ignored functions for WordPress sites */ 'call_user_func', 'call_user_func_array', 'socket_select', '???_op', 'op@1_???', 'op@2_???', 'op@3_???', 'op@4_???', 'op@5_???', '()main', 'do_action', 'apply_filters' );
Now we get a much nicer overview of what is slowing our site down!