Show WordPress Query Load Times

Here’s a good way to find out how many and what queries are being executed and how long it takes. Your code may be inefficient and here’s a good way to tell.

When troubleshooting

I’ve used adminfooter hook so this will show in the admin, you can use wpfooter or other late hooks to show on main site. Note $wpdb->queries will reveal table names to the source code so this shouldn’t be on public sites or proper user conditional tags should be added.

Leave a Reply

%d bloggers like this: