Skip to content

WordPress profiling patterns: Query Monitor, New Relic, Datadog

WordPress profiling with three tools that answer different questions — Query Monitor for the request you can reproduce, New Relic for trends over weeks, Datadog when the stack extends beyond WordPress.

A WordPress site that is slow at 2 PM every Tuesday is not the same problem as a WordPress site that is slow on first paint for everyone. Different problems need different profilers. Query Monitor shows what one request did. New Relic shows what every request has been doing. Datadog answers the same question across the full infrastructure when the slow PHP is downstream of a slow Redis that is downstream of a slow disk. Each is a different tool for a different question.

What’s happening

The three tools profile WordPress at different scopes:

  • Query Monitor: runs inside the WordPress request, instruments hooks, queries, HTTP API calls, and template loads. Output is per-request, visible in the admin bar dropdown. Best for “this one URL is slow when I load it now”.
  • New Relic APM: PHP agent installed at the server level, samples requests over time, surfaces aggregated transaction traces, slow query history, external service timings. Best for “what is the P95 of /shop/ this week vs last week”.
  • Datadog APM: similar to New Relic in scope, with stronger integration to the broader infrastructure (Redis, MySQL, the OS, container metrics). Best for “is this slowness in PHP, or in the database, or in the network between them”.

How to verify

Pick the right tool for the question:

# Is this URL slow right now, for me, with debug access?
wp plugin install query-monitor --activate
# Load the URL as logged-in admin, read the admin bar

# Is /shop/ slow over the past 7 days, on average?
# In New Relic: APM → Transactions → /shop/ → response time, throughput, error rate
# Or in Datadog: APM → Services → wordpress → /shop/ trace

# Is the slowness in PHP or downstream?
# In Datadog: flame graph for the slow request showing time in MySQL, Redis, external HTTP

For sites without an APM, install one before debugging recurring slowdowns. Trying to diagnose a Tuesday-2-PM problem from MySQL logs and PHP error logs alone is hours of work that an APM would resolve in minutes.

The fix

Use the three tools as a sequence, not in isolation:

  1. Start with the symptom: who is reporting slow? Is it editors (admin pages), visitors (front-end), specific URL patterns (checkout, search), or specific times?
  2. For one-URL one-time problems, use Query Monitor: log in as admin, load the slow URL, read the Component and Caller panels. The fix list is usually a plugin, a missing cache, or a missing index.
  3. For aggregate or recurring problems, use New Relic or Datadog: install the PHP agent on the WordPress host. Both have a WordPress-aware instrumentation that surfaces hook timings and shortcode renders. Look at the slowest transactions, the slowest external calls, and the database breakdown.
  4. For correlated problems across the stack, use Datadog: when a slow PHP transaction correlates with a slow Redis call which correlates with a high disk IO event, you need a single timeline across all three. Datadog’s APM integrates with Redis monitoring and host metrics for this; New Relic does it but less natively.
  5. Configure custom transactions for WordPress paths: by default, APMs see the WordPress request as index.php. Add custom naming so that /shop/, /wp-admin/post.php, /wp-json/wc/v3/products appear as distinct transactions. New Relic provides a WordPress plugin for this; Datadog requires manual dd_trace_set_url.
  6. Sample but do not over-instrument: 100% trace sampling on a high-traffic WordPress site adds load. Sample at 10% on the front-end and 100% on /wp-admin/ and slow URLs.

The combination of Query Monitor for ad-hoc diagnosis and an APM for trends is the standard pattern. Adding both does not duplicate work — they answer different questions.

Stack Harbor runs New Relic or Datadog as standard on enterprise WordPress support accounts and Query Monitor as a dev-time tool. If your site is slow and you do not have a profiler installed, book a 30-minute review.