On this page
What this issue is
Debug output is information a developer prints while building a site to see what the code is doing. It should never reach visitors. It leaks in two ways. On the page: raw text such as Notice: Undefined variable, Warning: Cannot modify header information, a var_dump() of an array, a JSON blob or a stack trace shown above your header or inside a form. In the browser console: console.log() calls that print form values, API responses, tokens or tracking payloads. Visitors rarely open the console, but anyone can, and so can scrapers and competitors.
Common causes are WP_DEBUG_DISPLAY left on in WordPress, a theme or plugin that echoes variables, a staging config pushed to production, a custom script with leftover console.log lines, and a tag in Google Tag Manager running in preview or debug mode.
Why it costs you leads or sales
Visible errors make a site look broken or unsafe, and people leave before they fill in a form or pay. Errors printed before the page headers can also break redirects, cookies and tracking scripts. Leaked data is a bigger risk: email addresses, order details, API keys or file paths in output can be a privacy problem and give attackers useful clues. Console logs alone rarely hurt conversion, but they often point to code that is failing quietly.
- Visitor submits formForm posts to the server
- Debug output printedWarning text sent before headers
- Redirect failsThank-you page never loads
- Conversion tagNever fires on the thank-you page
A PHP warning printed before the headers is sent can break the redirect to the thank-you page.
How to check if your site has it
Read the page as a visitor
Load your key pages (home, landing pages, form, checkout, thank-you page) and look at the top, the footer and inside forms for stray technical text.
Open the browser console
In Chrome press F12 (Cmd+Option+I on Mac), open the Console tab, reload the page and read the messages. Look for logged objects, emails, tokens and error messages.
Search the page source
Press Ctrl+U (Cmd+Option+U on Mac) and search for Notice:, Warning:, Fatal error, Stack trace, Array (, object( and debug.
Test the actions, not just the pages
Submit the form, add to cart and open the chat widget with the console open. Many logs only appear on interaction.
Check Google Tag Manager
Make sure no custom HTML tag contains console.log or debugging code, and that the live container version is published, not a preview.
How to fix it
Turn off error display
In wp-config.php set WP_DEBUG to false, or keep logging but hide output with WP_DEBUG_DISPLAY false.
Find the source
Deactivate plugins one by one on a staging copy, or switch to a default theme, to see which one prints the output. Update or replace it.
Remove leftover code
Search your theme and custom code for var_dump, print_r, error_log echoes and console.log, and delete them.
Search theme code
In Online Store > Themes > Edit code, search for console.log and the Liquid json filter output printed in the page, and remove them.
Check apps
Disable recently installed apps one at a time to see if one prints the output, then contact the app developer.
Audit custom HTML tags
Open Tags, filter by Custom HTML, and remove console.log lines or debugging scripts.
Publish a clean version
Submit and publish the workspace so the live container no longer contains the debug code.
Check custom code
Review Project settings > Custom code and any Embed elements for console.log lines, then publish the site again.
Disable debug mode
Set your framework to production mode (for example NODE_ENV=production, APP_DEBUG=false in Laravel) and turn off display_errors in php.ini.
Strip logs at build time
Configure your bundler to drop console calls in production builds.
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );require('esbuild').build({
entryPoints: ['src/app.js'],
bundle: true,
minify: true,
drop: ['console', 'debugger'],
outfile: 'dist/app.js'
});How to confirm it's fixed
- Key pages load with no stray technical text, in a private window.
- Page source has no Notice:, Warning:, Fatal error or var_dump output.
- Console is clean on load and after submitting forms or adding to cart.
- The form still redirects to the thank-you page.
- Server error logs still record errors, but nothing is shown to visitors.
How to prevent it happening again
Without a process
- Debug flags set by hand on the live server
- Logs added in a hurry and never removed
- Staging config copied to production
With a process
- Separate production config with debug off
- Build step removes console calls
- Release checklist includes a console and source check
Add a linter rule such as ESLint's no-console to catch logs before they ship, and review the live site after every theme, plugin or tag change.
How FunnelGuard handles this
FunnelGuard does not check for debug output or console.log leaks yet. It is a possible future check. Today, FunnelGuard runs your real customer journeys on a schedule, from the EU or the US, and checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That can surface the symptoms debug output causes, such as a form that no longer reaches its thank-you step or a conversion tag that stops firing, but it will not tell you that debug text is the reason.
To watch for this issue yourself, add the console and page-source checks above to your release checklist, keep error display off in production, and use a free tool such as Chrome DevTools or Lighthouse's best practices report to spot console errors. FunnelGuard also offers a free read-only website audit.
Questions people ask
Why is my website showing PHP errors or warnings on the page?
Your server or CMS is set to display errors, usually through display_errors or WP_DEBUG_DISPLAY. Turn display off in production and log errors to a file instead, then fix the code or plugin that causes the warning.
Is console.log on a live website a security risk?
It can be. Anyone can open the browser console, so logged form values, tokens, API responses or personal data are visible to them. Remove logs that print sensitive data and strip console calls in production builds.
How do I remove console.log from production?
Delete the calls from your source, or configure your build tool to drop them, for example esbuild's drop option or Terser's drop_console. Add the ESLint no-console rule so new ones are caught before release.
How do I turn off WP_DEBUG on a live WordPress site?
Edit wp-config.php and set WP_DEBUG to false, and WP_DEBUG_DISPLAY to false if you want logging without output. Save the file and reload the page to confirm the messages are gone.
Can debug output break my contact form or tracking?
Yes. Output printed before headers are sent can stop redirects and cookies, so visitors may not reach the thank-you page and conversion tags may never fire. Fix the output, then test the form end to end.
How can I check my site for leaked debug data?
Load key pages in a private window, open the browser console, and search the page source for terms like Notice:, Warning:, Fatal error and var_dump. Repeat after submitting forms and adding to cart.
Does FunnelGuard detect console.log or debug output?
No, not yet. It is a possible future check. FunnelGuard does monitor your form and checkout journeys and tracking hits, which can reveal related breakage.
Related issues
- PRF-257Lorem ipsum or placeholder text liveFix guide
- PRF-258Template placeholders shown ('[Company Name]', 'Your headline here')Fix guide
- PRF-259Unrendered merge tags on page ({{first_name}}, %%name%%)Fix guide
- PRF-260'Test' or 'staging' banner on live siteFix guide
- PRF-261Typos and spelling mistakes in headlines/CTAsFix guide
- PRF-262Grammar errors in key copyFix guide