Debugging WordPress on a Live Site: A Safer Production Workflow

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

By Greg Nowak. Updated 26 October 2026.

When checkout breaks or WordPress starts returning 500 errors, every change feels urgent. The business needs a working customer journey, and the person fixing it needs evidence. Changing several plugins, settings, and caches at once makes both harder.

A safer workflow is to contain the impact, capture the failing request, make one reversible change, and verify the outcome. Use staging wherever possible. If the problem only appears on the live site, agree who owns the investigation, what they may change, and when temporary diagnostics will stop.

Protect the business before changing WordPress

Define the failure precisely: the whole website, one checkout step, a form, login, or a scheduled import. Record the affected URL, time and timezone, error message, and recent changes. Ask whether orders, payments, or enquiries are still arriving behind the broken screen.

Give one person control of changes while someone else handles business updates. Pause unrelated deployments. Confirm a usable backup and restoration procedure, but distinguish reverting code from restoring the database: a database restore can overwrite orders and submissions received since the backup.

Check the administrator mailbox for a WordPress Recovery Mode message, which may identify a fatal error. Start with existing hosting and application logs before adding diagnostics.

Symptom First evidence to inspect Controlled next step
Whole site fails after deployment PHP log and deployment changes Assess rollback compatibility, then revert the identified change
Checkout or a form fails Failed request and integration records Confirm whether anything was recorded before retrying
Only some visitors see the fault Account state, cookies, and cache headers Compare one affected session with a fresh session
A background job fails Queue status, job log, and external service response Check for partial completion before rerunning it
Choose the next test from the evidence. A payment retry or job rerun can have consequences beyond the page you see.

Enable temporary logging without displaying errors

WordPress recommends local or staging environments for debugging. If production logging is necessary, edit existing definitions in wp-config.php rather than adding duplicates. Place them before the stop-editing comment:

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

This normally logs PHP diagnostics to wp-content/debug.log. Because that location may be publicly accessible, prefer a private log outside the public document root. Replace the existing WP_DEBUG_LOG line with a real path your host supports:

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

The directory must exist and be writable by the PHP process. Restrict access, confirm entries arrive, and monitor file growth. Avoid logging credentials, payment details, or complete customer requests.

PHP recommends logging production errors rather than displaying them. Ask the host to confirm that PHP-level display settings are also off: runtime settings cannot protect against a failure that prevents those instructions from executing.

Capture one failure and follow its request

Note the timestamp, reproduce once, and read the matching log window. Prioritise a fatal error or uncaught exception tied to that request. A deprecation notice deserves maintenance work, but its presence does not prove it caused the outage.

If the WordPress log is empty, inspect the hosting, web-server, or PHP-FPM logs. In browser developer tools, check the failed request’s status and response. A page loading successfully does not mean its checkout API or JavaScript worked. Redact sensitive information before sharing screenshots or request exports.

Isolate a plugin without disabling the business

With shell access, run WP-CLI from the correct WordPress installation. Capture the active-plugin list, then deactivate the plugin supported by the evidence. Replace suspected-plugin with its actual slug:

wp plugin list --status=active
wp plugin deactivate suspected-plugin

If a plugin prevents WP-CLI from starting, try:

wp plugin deactivate suspected-plugin --skip-plugins

The WP-CLI reference confirms that --skip-plugins still loads must-use plugins. On multisite, confirm the target site with --url and check network activation; --network affects the entire network.

Reserve bulk deactivation for a maintenance window with an agreed recovery plan:

wp plugin deactivate --all --exclude=critical-plugin

Replace the exclusion with the actual essential plugin slugs, comma-separated. This can still interrupt forms, payments, authentication, and security controls. After each change, repeat the same test and record the result.

Clear the cache that matches the fault

Browser, CDN, page, object, and PHP opcode caches need separate handling. Start with the affected URL or relevant cache entry where supported.

wp cache flush

This flushes the WordPress object cache; it does not universally purge page caches or CDNs. With persistent object caching on multisite, it typically affects every site and can cause a performance spike.

WordPress configuration guidance also distinguishes WP_CACHE, which controls loading advanced-cache.php, from the separate object-cache.php drop-in. Treating it as a universal cache switch can leave the real problem untouched.

Keep expensive diagnostics purposeful: SAVEQUERIES adds overhead, and SCRIPT_DEBUG is for core JavaScript or CSS investigation. Also check WP_ENVIRONMENT_TYPE: a development environment can enable WP_DEBUG when it has not been explicitly defined.

Finish by testing the customer journey

Restore the original diagnostic settings, remove or securely archive temporary logs, and confirm the intended plugin state. Test the original failure as a customer would, including the resulting order, enquiry, or background task. A working homepage is insufficient evidence that checkout recovered.

Leave a brief handover covering impact, cause, changes, verification, and remaining work. If your team needs help coordinating the host, developers, and business priorities, contact Greg about your WordPress issue. Include the affected journey, when it started, and what changed recently.

Related on GrN.dk

Need help with this kind of work?

Discuss your WordPress issue with Greg Get in touch with Greg.

Sources

Latest articles

Before WooCommerce 11.4 arrives, test your gift guide on a store copy. Choosing Medium should narrow the knitwear grid and leave the sale gifts below it alone.

AI can read the bank account number on a PDF invoice. If it differs from the supplier’s approved account, accounts payable puts the payment on hold and calls the supplier.

Let’s Encrypt moves to 64-day certificates on 10 February 2027. Check when each site renews, test the reload and verify the certificate visitors receive.

Work out which Drupal 10 sites can move to Drupal 11 by 9 December, who can resolve each blocker and how to test publishing and rollback before launch.

See how SharePoint access changes reach internal AI search, and test how long revoked content can still appear in results, generated answers, and citations.

At month-end, reconcile Shopify Payments against your bank statement and e-conomic. Use the payout ID to trace fees, refunds, and payouts that reach your bank the following month.

Trace an intermittent NGINX 502 through Cloudflare, upstream attempts, and application logs so you can see where the request failed and who should pick it up.

Find the apps, scripts and printers that still send mail through Microsoft 365 with a mailbox password, then test a replacement before the December 2026 change.

Find subscriptions and insurance expenses in e-conomic that should be spread over several months. See how AI reads the supporting documents and how your finance lead approves the proposed allocations.

Before relying on an AI project briefing, check which files it covered. A practical workflow for tracking documents, recording gaps and verifying key claims.