Query Monitor plugin for diagnosing WordPress issues

Query Monitor plugin for diagnosing WordPress issues

If you’re like me, you have enough WordPress know-how to be productive but can be overwhelmed by too many technical details. We’ve all had a moment like this: You come across a page on your site that loads slowly, but you just aren’t sure why. Many factors contribute to slow page loads, which makes finding the answer complicated.

When it comes to troubleshooting, we try to recommend tools that provide valuable information without being overwhelming. Query Monitor is one tool that balances useful debugging and performance information with ease-of-use.

Query Monitor in the WordPress plugin repository

Getting started with Query Monitor

Installing this plugin is easy:

  1. On your WordPress dashboard, navigate to PluginsAdd New.
  2. Search for “Query Monitor.” Click Install Now.
  3. Click Activate.

That’s it! Once you’ve installed Query Monitor, you’ll see a new set of numbers along your top toolbar, like this:

Query Monitor section in top toolbar

Here’s how to interpret those numbers:

  • 0.53s – That’s the amount of time it took to generate the full page.
  • 12.73MB – The size of the page, or the “memory usage.”
  • 0.0128s – The amount of time it took to query your database for this specific page.
  • 55Q – The number of queries to the database on this page.

For the most part, if your site is running well, these numbers are interesting, but not important to track. When viewing a slow page, however, these can be useful in helping you track down the source of the problem.

Query Monitor Dropdown
The Query Monitor toolbar dropdown menu

However, if you click on the Query Monitor numbers in the top toolbar, you’ll get a dropdown menu listing the reports you can view. Click on any given item in the dropdown to view that specific report, or scroll down the page to scan more detailed information.

Using Query Monitor

Let’s walk through the scenario where you have a slow-loading page without any obvious culprit. You can tell the page is slow, but you’re not sure of the cause. It could be database queries, a problematic plugin, or some other server problem.

With Query Monitor, you can easily check on the database queries by clicking the Queries by Component menu option. This provides an overview of the quantity and performance of the database queries within WordPress (Core) and your various plugins:

Queries by Component Section

Be sure to consider the bigger picture. Although the Plugin: wordfence entry above creates a lot of queries and loads 10x slower than most of the other plugins, the entire database impact is only 0.0266 seconds. That’s not a concern! Even if one plugin’s queries are a lot slower than others’, the total database impact is what ultimately determines whether your database queries are impacting page speed.

If you spot a potential problematic plugin, you can check this Queries by Component section before and after temporarily deactivating that plugin. This technique also works when enabling a brand new plugin to see what impact it may have on your database queries and their run time.

When the database ISN’T the problem

So you’ve used Query Monitor to determine that your slow pages don’t have any problematic database queries on them—now what?! 

Unfortunately, there are many factors that may contribute to page slowness, and it can take a fair amount of investigation to get to the bottom of them. We’ve addressed some of the most common issues on the blog, but Agathon clients can always email support for help getting to the bottom of an issue!

How do you troubleshoot site speed?

Do you use Query Monitor? Another tool? We’d love to hear what your process looks like!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.