Background pattern

The Ultimate WordPress Debugging Guide

Debugging WordPress doesn’t have to feel like chaos. When things break, slow down, or act strangely, there’s always a reason, and usually, a breadcrumb trail leading to it.

This guide is your roadmap for finding those breadcrumbs.

We’ll start with the easiest, safest steps anyone can follow, move into power-user techniques for people with server or command line access, and finish with developer-level tools for deep performance and code tracing.

By the end, you’ll not only know how to fix problems, you’ll understand them.

Start Here: Checking for Plugin or Theme Conflicts

Pre-flight Checklist

Before you begin:

  • Confirm you have current backups (database and files).
  • Record when the issue began and any relevant performance baselines (e.g., load times, error rate).
  • Create a staging copy of your site and verify whether the issue appears there.
  • If you have SSH or hosting-level metrics, monitor CPU, memory, and I/O usage while testing, spikes often confirm a deeper resource or plugin issue.

Thanks, Robin, for suggesting this pre-flight checklist!

Before making any changes, take a few minutes to observe what’s happening.

  1. Open your browser’s developer console (Ctrl+Shift+I on Chrome) and look for red errors.
  2. Check your PHP or web server error log for recent entries.
  3. Note the exact time you see the issue, you can match that timestamp with log entries later.

This initial observation helps you form a hypothesis instead of guessing. Once you’ve captured what the system is telling you, then proceed with the standard plugin, theme, and cache isolation steps.

Before any debugging begins, always rule out plugin and theme conflicts. Many strange issues, from broken layouts to missing buttons or admin errors, can come from plugins not playing nicely together or a theme behaving unexpectedly.

Then, start to debug simple:

  1. Switch to a default WordPress theme like Twenty Twenty-Five. This gives you a clean baseline and removes theme-specific code from the equation.
  2. Test your plugins methodically.
    • Deactivate all plugins, then see if the issue disappears.
    • If it does, the problem is plugin-related.
    • Reactivate plugins in batches (for example, half at a time) until the issue returns. This “divide and conquer” method helps you find the culprit quickly.
  3. Once you’ve identified the conflicting plugin or combination, keep them deactivated and proceed to the next steps in this guide to confirm the root cause.

Note: Switching themes directly in production can sometimes reset widgets, menus, and layout settings. If possible, use the Health Check & Troubleshooting plugin’s “Troubleshooting Mode” to safely test with a default theme without affecting what visitors see.

This should provide you with insight into whether this is related to one specific plugin or if two (or more) plugins are conflicting with each other.

If the conflict is so big that you’re just seeing a white screen when you visit your site in the browser, and you’re pretty sure it’s because of an update of a plugin, this is the best option. Get access to your site again:

  • Log onto FTP and go to /wp-content/plugins/. You can disable plugins by renaming the plugin folder temporarily. This works for themes as well, btw.

Thank you, Pat, for mentioning this super obvious one in the comments 😅.

The Quick Checks

For site owners, editors, and curious beginners. No coding required.

1. Start with the Basics

Before diving into logs or code, begin with the simple stuff, the things that solve half of all WordPress weirdness.

Try these first:

  • Clear your browser cache. Your browser may be showing an outdated version of your site. Try reloading with Ctrl + F5 (Windows) or Cmd + Shift + R (Mac).
  • Clear your site cache. If you use caching plugins (like WP Rocket, NitroPack, W3 Total Cache, etc.), clear or purge all caches.
  • Test in Incognito or a different browser. Sometimes browser extensions or cookies cause layout issues.
  • Temporarily disable optimization plugins. Minifiers or lazy-loaders can break scripts or styles.
  • Switch to a default theme. Go to Appearance → Themes and activate “Twenty Twenty-Five.” If the problem disappears, your theme is the cause.

Bonus: Install the free Health Check & Troubleshooting plugin. It has a “Troubleshooting Mode” that temporarily deactivates plugins and switches themes only for you, so you can test safely without affecting site visitors.

2. Enable WordPress Debugging

WordPress has a built-in logging system that can show you what’s failing behind the scenes, typically PHP errors or warnings.

Here’s how to turn it on:

  1. Open the wp-config.php file in the root of your site.
  2. Add (or edit) these lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

What this does:

  • WP_DEBUG turns on error reporting.
  • WP_DEBUG_LOG saves those errors to a file called debug.log.
  • WP_DEBUG_DISPLAY hides them from your website visitors (so you don’t show sensitive info).

Now, visit your site again, the problem page, ideally. Then check the file:

/wp-content/debug.log

You’ll see lines like:

[06-Nov-2025 13:44:22 UTC] PHP Warning:  Undefined variable $price in /home/example/public_html/wp-content/themes/mytheme/functions.php on line 42

This tells you when it happened, what type of error it was, where it occurred, and in which file.

3. Use Your Browser’s Developer Tools

Every modern browser includes a “Developer Tools” panel, often called DevTools, that shows what’s happening on your website in real time.

To open it:

  • Chrome: Ctrl + Shift + I (Windows) or Cmd + Option + I (Mac)

Tabs to know:

  • Console: shows JavaScript errors (the red messages). For example, missing scripts or blocked requests.
  • Network: shows requests made by your site (CSS, images, API calls). A red line means something failed, maybe a 404 or a 500 error.
  • Performance: helps visualize what loads slowly.
  • Lighthouse (Audit): runs a performance and accessibility report.

You don’t need to fix what you see yet; just note any red errors or failed requests. They’re valuable clues.

4. Check WordPress Site Health

Go to Tools → Site Health in your WordPress Dashboard.

  • The Status tab shows warnings and recommendations (like outdated PHP or inactive plugins).
  • The Info tab shows detailed environment data, your WordPress version, server software, PHP limits, active theme, and all plugins.

At the bottom, there’s a “Copy site info to clipboard” button.

If you’re asking for help, this is gold; it gives supporters or developers the context they need.

5. Document What You Find

Write down what you’ve done and what you’ve seen:

  • What you changed before it broke
  • What pages are affected
  • Any errors from the Console or debug.log

You should now have:

  • Debug logging turned on
  • A copy of your system info
  • A list of visible symptoms
  • Initial clues about what’s failing

The System Detective

For site managers or advanced users with hosting or SSH access.

1. Read Your Server Logs

When WordPress reports “500 Internal Server Error” or goes blank, the famous White Screen of Death (WSOD), the server logs usually hold the truth.

Server logs are text files that record everything the server does, including PHP errors, crashes, and warnings.

Typical places to look (depends on your host):

  • /var/log/apache2/error.log (Apache)
  • /var/log/nginx/error.log (Nginx)
  • Or inside your hosting panel (many have a “Logs” tab)

If you can’t find them or access them, reach out to your host’s support team. To watch the log live as it updates, use the tail command:

tail -f /path/to/error.log

“Tail” shows the tail end (the latest lines) of a file and updates in real time, so you can watch errors appear as you reload the site.

2. Understand Plugin and Theme Conflicts

Plugins and themes can conflict with each other, often when two try to modify the same part of WordPress.

The goal: isolate which one’s responsible.

Manual way:

  • Deactivate all plugins.
  • Switch to a default theme.
  • Reactivate each plugin one at a time until the issue returns.

Faster way: use the WP-CLI.

3. What Is WP-CLI (and Why It’s Useful)

WP-CLI is the WordPress Command Line Interface, a tool that lets you control your site using commands in a terminal or SSH session.

For example:

wp plugin list

lists all plugins, while:

wp plugin deactivate --all

deactivates them all instantly.

Re-enable one plugin:

wp plugin activate plugin-name

It’s much faster for debugging than clicking around the Dashboard.

4. Use WP-CLI Diagnostic Tools

If you have WP-CLI installed, you can add official packages to diagnose your site deeper.

The WP Doctor allows you to check numerous items

wp doctor check

This runs built-in health checks, like missing constants, outdated PHP, or bad file permissions.

WP Profile

wp profile stage

This measures how long each stage of a page load takes (plugins, themes, core, etc.). It’s a great way to spot performance bottlenecks.

You may need to install both WP Doctor and WP Profile depending on your host’s setup. Contact your hosting company to make sure what you have and how you can have them added to your site.

5. Check Performance and Resource Limits

Sometimes problems are simply resource-related: not enough memory, too many database queries, or timeouts.

Increase PHP memory in wp-config.php:

define( 'WP_MEMORY_LIMIT', '256M' );

Check database integrity:

wp db check

Transients are temporary bits of cached data WordPress stores in your database to speed things up.

If they pile up or expire incorrectly, they can cause slowdowns.

You can view them with:

wp transient list

and delete expired ones:

wp transient delete-expired

A wonderful plugin that allows you to manage your options in all the ways is the AAA Option Optimizer plugin.

6. Cron Jobs and Scheduled Tasks

WordPress uses “cron jobs”, automated tasks for things like publishing scheduled posts or checking for updates.

To see if one is stuck:

wp cron event list

If you see overdue jobs, you can run them manually:

wp cron event run --due-now

You’ll now know whether the issue lies in a plugin, theme, database, or server environment. If you can’t access the CLI, there is a plugin that allows you to see this as well: WP Crontrol

The Developer’s Lab

For developers and advanced troubleshooters who want to go beyond surface-level fixes.

1. Developer Plugins

Plugins like Query Monitor and Debug Bar are invaluable.

Query Monitor shows:

  • Database queries (and how long they took)
  • Hooks and actions firing on the page
  • HTTP API calls (like API requests)
  • Enqueued scripts and styles

Debug Bar adds a simple debug menu in the admin bar with errors, queries, and cache stats. More about how I diagnose WordPress performance bottlenecks.

Install via Dashboard or WP-CLI:

wp plugin install query-monitor --activate

2. Set Developer Constants

WordPress has extra constants for debugging at a deeper level.

Add to wp-config.php:

define( 'SAVEQUERIES', true );
define( 'SCRIPT_DEBUG', true );
define( 'WP_ENVIRONMENT_TYPE', 'development' );

What they do:

  • SAVEQUERIES: Logs every database query and how long it took.
  • SCRIPT_DEBUG: Forces WordPress to load unminified JS/CSS, useful for debugging scripts.
  • WP_ENVIRONMENT_TYPE: Marks the site as development, staging, or production, useful for conditional code.

Remember to turn them off in production to avoid slowing down your site.

3. Tracing Code Execution

For full control, use a step debugger like Xdebug or Ray.

They let you pause code execution, inspect variables, and see function calls, like watching WordPress think in real time.

Local environments like LocalWP, Lando, or DevKinsta make this setup easier.

4. Debugging REST API and AJAX

Many modern WordPress features use the REST API or AJAX to fetch data behind the scenes.

You can inspect these in your browser’s Network tab:

  • Look for requests to /wp-json/ (REST API) or admin-ajax.php.
  • Click on them to see the response; an error message often explains the issue directly.

For deeper testing, use Postman or curl:

curl https://example.com/wp-json/wp/v2/posts

5. Profiling Performance

To find what’s slow:

  • Use wp profile, a WP-CLI command to see which stages are heavy.
  • Query Monitor shows which plugin, query, or hook consumes time.

Combine both to track slowdowns to exact code lines.

6. Collect and Share Environment Data

When you’ve gathered your findings and need to share them (for example, with your host or support team), use WP-CLI to summarize:

wp --info
wp core version
wp plugin list
wp theme list

These commands reveal your WordPress version, PHP version, and active components, without exposing passwords or sensitive data.

Appendix: Tools and References

CategoryTool / ResourceDescription
WordPress DocsDebugging in WordPressOfficial reference for constants and logging
Health & InfoHealth Check PluginTroubleshooting mode and system info
Developer ToolsQuery Monitor, Debug BarDetailed debugging data
Command LineWP-CLIManage WordPress via terminal
Performancewp-cli/profile, DevTools Performance TabFind slow hooks, queries, and scripts

FAQs

What is the White Screen of Death (WSOD)?

The White Screen of Death occurs when WordPress fails to load due to a serious PHP error, leaving you with a blank page. It typically happens when a plugin or theme triggers a fatal error. The best way to diagnose it is to enable WP_DEBUG_LOG in wp-config.php and check the debug.log or your server’s error log. You can also rename the plugins folder temporarily to disable all plugins and confirm if one is responsible.

What is a PHP fatal error vs. a PHP Notice?

A PHP fatal error stops WordPress from running. It means the code encountered a problem so serious it couldn’t continue, for example, calling a function that doesn’t exist. These errors appear as Fatal error: in your logs.

A PHP Notice, on the other hand, doesn’t stop execution. It simply warns that something may be off, like using a variable that hasn’t been defined. Notices can safely be ignored in most cases but are worth reviewing if they appear frequently.

What Does PHP Deprecated Mean?

A deprecated warning means a function or feature is outdated and will be removed in future versions of PHP or WordPress. It still works now but should be updated. These are usually marked as Deprecated: in your logs. Plugin and theme developers should address these warnings, but they rarely cause immediate failures.

Why Does My Site Go Blank After an Update?

If your site goes blank immediately after updating a plugin, theme, or WordPress core, it’s often due to incompatible code or PHP version differences. Roll back the update (if possible) or disable the conflicting plugin via FTP or WP-CLI. Always test updates in a staging environment first to avoid downtime.

What If Debug Logs Don’t Appear?

If debug.log isn’t being created, check that your wp-content folder is writable by the server. You can also add this to wp-config.php to specify an explicit log location:

define( 'WP_DEBUG_LOG', '/path/to/your/logs/debug.log' );

Also make sure WP_DEBUG is set to true and that your server’s PHP settings allow error logging.

Why Are There So Many Warnings in My Log?

Some plugins are verbose in their error reporting, even for minor issues. Frequent notices or deprecated warnings often indicate outdated or sloppy code, not necessarily a critical error. Focus first on warnings and fatal errors, then review notices later if you want to clean up your codebase.

Wrapping Up

Debugging WordPress isn’t just about fixing what’s broken; it’s about understanding how your site works.

Next time something feels off, don’t panic. Open your logs, your tools, and your curiosity. WordPress is telling you what’s wrong; you just have to learn to listen.

Category:

Stay in the Loop

Whether you’re here for personal reflections or deep WordPress insights, there’s more where this came from. I write two newsletters worth your time. Each serving a different part of my brain (and maybe yours too).

If you’re serious about building faster, more secure, and more reliable WordPress sites, this newsletter is for you. I focus on the news around tools, plugins, and practices that power professional-grade WordPress sites.

This is my personal newsletter where I share things I blog about, ideas I’m exploring, books I’m reading, tools I’m testing, and the occasional strong opinion loosely held.

Comments

27 responses to “The Ultimate WordPress Debugging Guide”

  1. If the site isn’t working and you’ve got the white screen of death, you can disable plugins and themes by renaming the folder of the plugin using FTP

    1. Cheers, Pat. Can’t believe I forgot to mention this super basic one. It’s been added!

      1. …Or just add a subfolder within /plugins conveniently named something like “AAA” so it appears first, and then move the usual suspects there one by one to identify which one is bringing the site down. Or move all plugins there and then bring them back one at a time for a longer process of elimination.

        Enabling debugging are looking at logs are a more efficient and less disruptive approach, especially if there are many plugins active.

  2. Great post Remkus. Some suggestions that have helped me in the past:

    Pre-flight checklist:
    – Confirm backups (files and DB)
    – Note the exact time the issue began and current key performance metrics (baseline)
    – Create a staging copy (and confirm whether the issue occurs there, if it does then rather test on staging)

    I’d also add something about monitoring CPU, memory, and I/O for changes (via SSH or hosting tools, if available). This is usually the first place I go to see what’s happening and if anything I do moves the needle.

    1. Excellent suggestion, Robin. I’ve added it to the opening section!

      1. Is there ever a “current” backup, or just the most recent one you have available — which is not the same as “last known good,” and if there’s a potential breach, the reliability of a backup is a whole ‘nother problem.

  3. Looks pretty complete to me.
    One thing I would add (even if it isn’t directly wp related):

    Check .htaccess (or nginx config) and maybe try the default one

    Also php.ini / .user.ini

    Also, if php error logs are empty or you can’t find them, you could enable them manually and change the path

    ini_set(“log_errors”, 1);
    ini_set(“error_log”, “/path/to/php-error.log”);

    1. Good one, yeah. Sometimes weird things happen when plugin just add random things to that.

      I will have a think on how to add this, but thank you!

  4. Terrific list! Just when I thought you were missing something, you mentioned it in the next section lol

    I would suggest InstaWP or LocalWP for the simplest staging / dev environments to setup regardless of the host company. I’ve found them both extremely valuable in determining if it’s a hosting issue or truly a plugin / theme issue. Caught a few hosts over the years limiting things that we needed for some plugins to run properly.

    1. Thanks, Daniel! Appreciate that.

      And you’re right. LocalWP/InstaWP deserve a spot in this. Lemme think about where to add them

  5. WP Crontrol is also a handy plugin in case wp cli is not available, or to guide a customer on cron jobs.

    1. Great alternative to mention, yes. Thanks Rogier!

  6. Before starting at the start, just look without doing anything. Check the PHP error log and browser console, before deactivating plugins or make other changes. Without an analysis, you are just guessing.

    Be careful when you switch themes. I’ve seen it happen many times, that after switching back, settings (like widgets, menus, styling) were lost. It’s much safer to use the Health Check & Troubleshooting plugin.

    Many more advanced and less known options are only quickly mentioned but don’t explain how they work. It looks like the second half of the steps are still in draft.

    If users have a site manager, I’m sure they prefer that the user doesn’t try too much (except for checking logs, telling what they did and clearing the cache). They often create more damage and “contaminate the crime scene” by removing evidence.

    There are quite a few small issues, but it would take too much time to list them all right now.

    1. Processsed what I could from your feedback, thanks.

  7. Very useful – I would like to see links for WP Doctor and WP Profile, I know I can search but knowing where to get them would be handy. Also I haven’t come across Xdebug or Ray before. And maybe point out there are some handy debug log viewers that let you switch the DEBUG state on and off easily.

    The number of times that disabling all the plugins turns out to be the best route to diagnose a problem is unreal. Also make sure you have FTP access into the site – as someone else suggested, being able to rename a plugin folder is a quick way to disable a plugin.

    Also I use WP Code for snippets – very easy to switch them on and off, and it auto disables crashing code.

    Thanks for this guide, very useful, Bill.

    1. Good points, Bill. I’ll add some more links.

      Plugins inside of WordPress that allow you to add snippets should be banned though. They’re a performance hit, but above all, they’re a security threat like no other .

      1. Henk van den Bor Avatar
        Henk van den Bor

        Hi Remkus, do you have info on the performance hit by plugins like WP Code?

      2. With a tool like Code Profiler Pro the impact is easily measurable.

        But you can also quite easily reason why it has to be slower. You’re loading quite an extensive plugin inside of WordPress to change something that’s stored in a database. So, not only do you need to load all of WordPress fist, then that plugin, you then need to retrieve it from the database. All expensive resource stuff.

      3. I believe there are some (one?) code snippet plugins that store your code in a file rather than the database for performance benefits but arguably a security tradeoff. If somene has gained or bypassed admin privileges, however, they can do whatever they want whether you have a snippet plugin installed or not, right? Using plugins like this for live sites is a bad idea IMO just because of the footgun potential from a legitimate admin messing with them or forgetting what they do.

  8. Great article! Lots of good infos here My 2 cents:

    – Remember to rolloback and do cleanup after you finish: don’t leave an error log that will write a huge log file with time file, or a resource-intensive plugin, or SCRIPT_DEBUG enabled, as it will deliver unminified CSS and JS, etc

    – String locator: is great troubleshooting plugin, will help you find where a function name or any text string is coming from, on which file is it.

  9. Nicely done, Remkus — this guide nails the debugging workflow for WordPress: starting smart, proceeding with clarity, and finishing with real depth. You’ve turned what’s often chaos into a clear path — thanks for sharing.

  10. Very nice go-through indeed. What I do, but this is due to the need for speed in finding the culprit as fast as possible: I immediately create a staging/testing clone and before anything, I set wp_debug to true. This, at least in my case, solves 95%+ of the problems as you can quickly see, what is going on, especially, if the problem is caused by a plugin or theme. Then, if the hints and messages you get from the debug display do not lead to an immediate solution, I go the long (and thorough) way you describe in pretty much the same order. Nicely done!

    But there is one case – gladly, I experienced it only twice until now – where none of the mentioned actions in your list might help, but which could be a cause for a client calling and describing their site as “slowing down” or “acting strangely”: Look for files in document root, wp-content and other directories that should not be there and also check your database for things that should not be there. Also, have a look in Google Search Console or do a site search for your domain, and check, if there might be something published on your domain that is outside WP, but inside it’s hosting. Sometimes, you can even find things that are happening by looking at your sitemap. Yes, I am talking about malware, rootkits, and other ways of having a compromised website and/or hosting.

    I know that in a strict sense this is not “WP debugging” per se, but you could name it as an exclusionary factor to check for the well functioning of your website. And yes, I know, one can put that burden on the selection of a good hosting solution that regular scans for compromised or additional files (and informs you before your client does). Yet still, it is a quick look into a few folders on your server and once you have an eye for what should and what should not be there, you know which way to go and if you maybe need additional help.

  11. Thanks for this great list. I have some small additions:

    Some caching plugins allow bypassing the cache with a URL parameter, like WP Rocket with “/?nowprocket”:
    https://docs.wp-rocket.me/article/1285-bypass-wp-rockets-caching-and-optimizations

    And sometimes a core update or PHP update causes issues with outdated plugins. This is not easily spotted, because WP does not show the last updated info anywhere. Plugins could be a decade old without any updates or even closed, but there is no info on the plugin list available. But there are plugins showing this:
    https://wordpress.org/plugins/plugin-report/ (Disclaimer: I am maintaining this plugin, but there are more plugins providing this info.)

    The Health Check plugin also has a fourth tab with more tools. Integrity testing, mail testing, etc. – very useful for basic debugging.

    An open REST API also shows some interesting information.

    External linkcheck and SSL check (looking for mixed content issues) are also on my first-to-check list.

  12. Thanks for this great summary of debugging steps!!!

    I’d like to ‘suggest’ three developer-oriented plugins I created that might be useful:

    1. Debug Log Manager: https://wordpress.org/plugins/debug-log-manager/ (10k+ active installs, easily toggle debugging, dedupe log entries, alternative for ‘tail’, etc.)

    2. System Dashboard: https://wordpress.org/plugins/system-dashboard/ — various info about the environment, including cron jobs, options table, etc.

    3. Variable Inspector: https://wordpress.org/plugins/variable-inspector/ — a simpler alternative to Xdebug / Ray. Focus on inspecting PHP $variables. The advantage is that it works on-site (within WP).

    1. Excellent additions, Bowo. Thanks for sharing!

  13. When debugging is impossible I create snippets/plugins to see what is going wrong.
    https://github.com/szepeviktor/wordpress-website-lifecycle/tree/master/debug

    1. Ooh, I like those! Thanks for sharing, Viktor!

Leave a Reply

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