Install module
wp package install wp-cli/profile-command
Run module
wp profile stage
Run module on specific part
wp profile stage bootstrap
Run module and show hooks for each stage
wp profile stage --all --orderby=time
Run module and show hooks for each stage and filter out zero-like values
wp profile stage --all --spotlight --orderby=time
Dig into the wp hook
wp profile hook wp
Dig into all hooks with spotlighs
wp profile hook --all --spotlight
Simulate loading of specific URL
wp profile hook --all --spotlight --url=https://mywordpress.local --orderby=time
If problematic callbacks, extract them
grep -ril generate_add_navigation_after_header wp-content/themes
If multiple results
grep -ril gettext wp-content/plugins/ | awk -F / '{ print $3}' | sort -u
Output filename, line number and before/after characters
grep -rHin generate_add_navigation_after_header wp-content/themes
Deactivate plugin
wp plugin deactivate plugin-name
Simulate plugin deactivation
wp profile hook --all --spotlight --skip-plugins=plugin-name