Getting Started

Deployment Deployment - Diagnose Migrations Staging

Site Management

Backups Client Reporting Passwords Plugin Automation Plugin Management - Global Plugins & Themes - Diagnose Plugins & Themes - General Plugins & Themes - Git Plugins & Themes - Logs Must Install SMTP White Label WordPress Updates

Caching & Performance

Caching Caching - Blogs/Articles Caching - Diagnose Caching - Git Caching - WooCommerce Redis Optimize & Scale

Security

Security Security - Firewall

CDN & DNS

CDN CDN - AWS CDN - Cloudflare CDN - Diagnose Domains & DNS

Server & Tools

CRON Jobs Database Debug Tool PHP Settings Redirects SEO Tools Server Errors sFTP SSL Monitoring Analytics & Logs

Staq Billing

Staq Billing > Account Staq Billing > Client Staq Billing > Setup

Media

Media Media - Diagnose Media - Optimize

Accounts & Billing

Accounts & Billing

General

WordPress Hosting Website Diagnose Troubleshoot - Other

My Website is Slow – How to Debug


On this page

    Slow page load times in WordPress can occur for various reasons. Below are some of the most common causes:

    • Inefficient database queries
    • PHP errors
    • Plugin or theme incompatibility with the current PHP version
    • Broken code
    • Inefficient or excessive requests
    • DDoS attacks
    • Plugin or theme bloat or misconfiguration
    • No caching applied

    Here’s how to debug and resolve these issues effectively:

    Enable WP_Debug via Staq Debug

    Use the Staq Debug tool to identify any errors causing slow performance. Even if no critical error appears, logs may reveal underlying issues such as PHP errors or memory exhaustion.

    Example Use Cases

    The screenshot below shows a database error caused by the RankMath plugin:

    RankMath Debug Error

    For WooCommerce Product Pages or Slow Page Builders

    If a WooCommerce product page takes too long to save or if a page builder like Elementor has a spinning widget panel or a page loads too slow inside WordPress, enabling WP_Debug can help identify the plugin or theme causing the issue. Follow these steps:

    1. Enable WP_Debug in the Staq Debug tool (inside Staq Panel > Debug).
    2. Refresh the slow page or perform the action (e.g., save a product or edit a page).
    3. Check the debug logs inside the WordPress tab for errors, such as:
      • PHP Fatal errors
      • Memory exhaustion messages
      • Errors pointing to a specific plugin or theme

    For instance, in the screenshot above, you can see the issue related toRankMath issue which. To rectify involved:

    • Navigating to the RankMath settings.
    • Selecting Re-create Missing Database Tables.
    • Clicking Re-create Tables.

    This demonstrates how Staq Debug can quickly pinpoint and resolve issues.

    Debugging Database Queries with Staq Query Tool

    Steps to Debug

    1. Access the Query Tool:
      • Log in to your WordPress dashboard.
      • Go to Staq Hosting > Advanced > Monitor.
    2. Enable Monitoring:
      • Click Enable monitor.
      • Optionally, enable Monitor hooks for detailed tracking.Enable Staq Query Monitor
    3. Reproduce the Issue:
      • Perform the action causing slowness, such as saving a WooCommerce product, editing with a page builder, or publishing a post/page.
      • Add a unique query string (e.g., ?debug-product-save) to the URL for easy tracking in debug logs.
    4. View and Analyze the Debug File:
      • Go to Staq Hosting > Advanced > Monitor.
      • Click View debug file to examine executed queries, durations, and hooks.View Debug File
    5. Identify the Problem:
      • Look for slow queries, resource-heavy plugins, or excessive database calls.
      • Use the identified data to narrow down the root cause.

    Example:

    1. Enabled the debug feature in Staq Hosting.
    2. Visited the problematic page and saved it while monitoring logs.
    3. Noticed the DB Time was fast (e.g., 0.345 seconds).
    4. Identified a significant delay between wp_loaded and shutdown, indicating a plugin/theme issue.
    5. Disabled debug mode after testing to avoid slowing down the site.

    Debug Example

    Debugging with Query Monitor Plugin

    If Staq Query Tool indicates a plugin or theme issue, use the Query Monitor plugin for deeper insights.

    How to Use Query Monitor

    1. Install and activate the Query Monitor plugin.
    2. Perform the problematic action (e.g., saving a product, publishing a page, or editing with a page builder).
    3. Open the Query Monitor console from the WordPress admin bar and review:
      • PHP Errors: Look for plugin or theme errors.
      • Slow Queries: Identify long-running database queries.
      • “Doing it wrong” Warnings: Highlight deprecated or problematic code.

    In the above example in the screenshot,

    • The PHP Errors identified the following problematic plugins:
      • password-protected (plugin)
      • wc-dynamic-pricing-and-discounts (plugin)
    • After disabling these two plugins (the site was running PHP 8.2), the PHP Errors and “Doing It Wrong” warnings disappeared upon refreshing the page.
    • Those 2x plugins were re-activated but the PHP version was downgraded from 8.2 to 7.4, resulting in no PHP errors being triggered, confirming that the identified plugins were not compatible with PHP 8.2.

    As a result, the website’s performance improved significantly, with noticeably faster load times.

    Check for Third-Party Requests

    Open your browser’s Inspect Element > Network tab and refresh the page. Identify slow requests and determine if they originate from:

    • Your server (e.g., unoptimized queries or broken plugins).
    • Third-party sources (e.g., external fonts or analytics scripts).

    Is Caching Applied?

    Ensure caching is enabled. Use this guide to confirm.

    Assess Resources

    Check if resource limits (e.g., PHP workers, memory) are being reached. Use this guide for details.

    Optimize PHP and AJAX Speed

    Once the issue is resolved, follow this guide to improve PHP and AJAX performance.

    DDoS Attacks

    If all else fails, check if the site is under attack. Follow this DDoS prevention guide.

    Need some help?

    We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.