Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

Debugging WordPress on a Live Site: A Safer Workflow

Illustrated infographic summarizing: Debugging WordPress on a Live Site: A Safer Workflow

By Greg Nowak. Last updated 2026-07-16.

When a live WordPress site starts returning 500 errors, showing blank pages, or breaking checkout, every diagnostic change carries business risk. The objective is not simply to “turn debugging on.” It is to gather useful evidence during a short, controlled window while keeping technical details away from customers.

The following workflow helps business owners, operations leads, and agency teams investigate production problems without turning one fault into several. If the issue can be reproduced on staging, work there. When it only happens in production, make one change at a time and agree on a rollback point before starting.

Protect the site before changing anything

Confirm that you have a recent, restorable backup. Then record the time the problem started, the affected URL or user journey, and the most recent changes. Include plugin and theme updates, deployments, PHP upgrades, hosting changes, scheduled jobs, CDN rules, and third-party integrations.

Test the failure once before changing the configuration. Note whether it affects everyone or only particular users, browsers, locations, account types, or transactions. Those details often reveal more than a large undifferentiated error log.

Log errors without displaying them

WordPress recommends using its debugging tools on local or staging installations rather than live sites. When production debugging is unavoidable, edit the existing debug definitions in wp-config.php—do not create duplicates—and place them before the stop-editing comment:

// Temporary production diagnostics: log, but do not display.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

This normally writes messages to wp-content/debug.log without adding them to rendered pages. PHP’s own documentation also recommends logging instead of displaying errors on production systems.

The default log location may be accessible from the web. Where your server permits it, set WP_DEBUG_LOG to an absolute path outside the public document root:

define( 'WP_DEBUG_LOG', '/secure/path/wp-errors.log' );

Use a path that the PHP process can write to, restrict access, and remove or archive the file when the investigation ends. Logs can contain internal paths, email addresses, request data, and integration responses, so treat them as sensitive operational records.

Read the failure window, not the whole log

Reproduce the problem once, note the exact time, and inspect entries from that window. Prioritise fatal errors and exceptions that align with the failed request. Notices and deprecation warnings deserve maintenance work, but they do not necessarily explain today’s outage.

If debug.log remains empty, inspect the hosting control panel or server-level PHP error log. A syntax error or startup failure can happen before the runtime ini_set() call takes effect, so the WordPress log is not the only source of evidence.

What you observe Investigate first Controlled next test
The failure began after an update The plugin, theme, or file named in the fatal error Deactivate the likely component and reproduce once
Output differs between visitors Page cache, CDN, object cache, then browser cache Purge the relevant layer and retest the same URL
A form or checkout fails PHP log, browser network response, and integration logs Use a safe test transaction or staging reproduction
Scheduled work fails Cron events, loopback requests, and queue logs Run the specific job under controlled conditions
Core admin JavaScript is broken Browser console and network panel Temporarily enable SCRIPT_DEBUG
A focused triage matrix helps prevent unrelated production changes from obscuring the original fault.

Isolate plugins carefully with WP-CLI

If wp-admin is unavailable, WP-CLI can deactivate a suspected plugin without relying on the browser:

wp plugin deactivate plugin-slug

For broader isolation, first record what is active. During an agreed maintenance window, you can deactivate plugins while preserving an essential component:

wp plugin list --status=active
wp plugin deactivate --all --exclude=critical-plugin

Bulk deactivation can interrupt payments, forms, security controls, authentication, caching, and multilingual routing. On a commercial site, it is an incident action rather than a casual test. Start with the component named by the evidence and reactivate known-good plugins promptly.

If a normal plugin prevents WP-CLI from loading WordPress, the global --skip-plugins parameter can help the command start. Must-use plugins still load, however, so this option does not isolate everything.

Clear the cache layer you actually mean

Do not treat WP_CACHE as a universal cache switch. WordPress documents it as a setting that loads wp-content/advanced-cache.php; it does not automatically disable a hosting cache, CDN, persistent object cache, or browser cache.

WP-CLI can flush the WordPress object cache:

wp cache flush

That command does not purge every other cache layer. On multisite installations using a persistent object cache, it will typically affect every site and may create a production performance spike. Identify the cache owner and scope first. A targeted page or CDN purge is preferable when the symptom is limited to one URL.

Use deeper diagnostics only when justified

Leave SCRIPT_DEBUG off unless you are tracing WordPress core JavaScript or CSS. It loads development versions of core assets and is not required for ordinary PHP debugging. Likewise, avoid enabling SAVEQUERIES casually on production because collecting every database query adds overhead.

Check WP_ENVIRONMENT_TYPE as well. If WordPress sees the environment as development and WP_DEBUG has not been defined explicitly, it can enable debugging automatically.

Close the debugging window cleanly

Once you have enough evidence, restore the existing configuration rather than adding another block:

define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define( 'SCRIPT_DEBUG', false );

Remove or secure the temporary log, restore deactivated plugins, clear only the caches affected by the fix, and test the original customer journey. Record the cause, evidence, changes, and follow-up work so the next person does not have to repeat the investigation.

If payments, memberships, personal data, multisite, recurring jobs, or shared caching are involved, early escalation is usually cheaper than prolonged production experimentation. Greg can help contain the issue, distinguish application faults from infrastructure symptoms, and turn the evidence into a practical repair plan. Get in touch to discuss the site and its current symptoms.

Related on GrN.dk

  • CMS Upgrades in 2026: A PHP Roadmap for WordPress and Drupal Sites
  • WordPress Security Releases Still Need an Ops Runbook for Business Sites
  • AI Crawler Control for Business Websites: Protect Content Without Sacrificing Search Visibility

Need help with this kind of work?

Get help debugging your WordPress site Get in touch with Greg.

Sources

  • Debugging in WordPress
  • Editing wp-config.php
  • wp plugin deactivate
  • wp cache flush
  • PHP Runtime Configuration: Errors and Logging
Last modified
2026-08-12

Tags

  • wordpress
  • Debugging
  • WP-CLI
  • Website Operations
  • Log in to post comments

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: Does Your AI Chatbot Clearly Identify Itself?
Does Your AI Chatbot Clearly Identify Itself?
2026-08-25

The EU’s transparency requirements for AI chatbots now apply. Here is how to make your bot’s identity clear, limit its system access and provide a genuine route to a member of staff.

Illustrated infographic summarizing: Should publishers add Google’s new Preferred Sources button?
Should publishers add Google’s new Preferred Sources button?
2026-08-24

Google’s Preferred Sources button is worth a controlled test for eligible publishers, with careful choices around placement, performance and measurement.

Illustrated infographic summarizing: Search Console Can See TikTok Now. Your Reporting Has to Catch Up
Search Console Can See TikTok Now. Your Reporting Has to Catch Up
2026-08-23

Google can now report how social profiles appear in Search. Here is how to measure cross-channel discovery without mistaking visibility for business results.

Illustrated infographic summarizing: Your AI workflow has logs. Can they explain one bad decision?
Your AI workflow has logs. Can they explain one bad decision?
2026-08-22

Logs can show that every service worked while leaving a bad AI decision unexplained. See how connected traces and careful redaction close the gap.

Illustrated infographic summarizing: Security Questionnaires Eat Into Selling Time—Let AI Find the Evidence
Security Questionnaires Eat Into Selling Time—Let AI Find the Evidence
2026-08-21

NIS 2 is generating more supplier questionnaires. A controlled AI assistant can find approved answers and sources—and route uncertain cases for review.

Illustrated infographic summarizing: Locked out of your Apple developer account? Fix it before October 1
Locked out of your Apple developer account? Fix it before October 1
2026-08-20

Apple's updated developer agreement must be accepted by October 1, 2026, and many small app owners cannot even log in. Here is where Apple's two-factor codes really go, and how to fix your access before the deadline.

Illustrated infographic summarizing: Cloudflare Workflows Now Charges by the Step—Price the Outcome
Cloudflare Workflows Now Charges by the Step—Price the Outcome
2026-08-20

Cloudflare Workflows now bills paid plans for steps and stored state. Here is how to track cost per completed outcome without weakening reliability.

Illustrated infographic summarizing: Google’s AI Search Toggle Is a Publishing Decision, Not an SEO Setting
Google’s AI Search Toggle Is a Publishing Decision, Not an SEO Setting
2026-08-19

Google’s AI Search toggle forces a commercial choice about visibility, attribution and content use. Here’s how to make that choice responsibly.

Illustrated infographic summarizing: From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
2026-08-18

AI can reduce the work involved in processing supplier invoices, but reliable bookkeeping requires validation, duplicate checks, approval and a clear audit trail.

Illustrated infographic summarizing: Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
2026-08-17

Nginx 1.30 defaults upstream proxying to HTTP/1.1 with keepalive enabled. Here is what to inspect, model and test before upgrading.

More articles

Built by AI — available for your business. The daily articles on this site are researched, written and illustrated by an autonomous AI pipeline. At nowa.dk I install the same kind of AI automation in businesses at fixed prices — site in Danish, English version here, and web/marketing agencies have a dedicated page.

RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register