On this page
What this issue is
PHP is the language that runs WordPress, WooCommerce and many custom sites. When the code hits a problem, PHP can print a message straight into the page. You see lines such as Warning: Undefined array key "email" in /wp-content/themes/mytheme/form.php on line 42 or a long stack trace (a list of the function calls that led to the error).
Why it costs you leads or sales
Visitors judge trust in seconds. Raw code in a headline or above a checkout button looks like a hacked or abandoned site, so people leave. Messages can also push your layout around, hide a button, or break a form that relies on the page rendering fully.
There is a security cost as well. Messages reveal server paths, plugin names, database table names and sometimes query details. Attackers use this to target known weak plugins.
- Ad clickVisitor lands on page
- PHP warning printedRaw error text above the form
- Visitor loses trustPage looks hacked or broken
- Form submitNever reached
A warning on the landing page breaks the layout and trust before the form is reached.
Example: illustrative numbers only, showing how visible errors could depress conversion rate.
How to check if your site has it
Open key pages in a private window
Check your home page, landing pages, contact page, cart and checkout. Errors can be hidden for logged-in admins or appear only for visitors.
Search the page text
Press Ctrl+F (Cmd+F on Mac) and search for 'Warning:', 'Notice:', 'Deprecated:', 'Fatal error:' and 'Stack trace'.
View the page source
Errors may sit inside HTML comments or hidden elements. Open view-source: and search the same words, plus '.php on line'.
Test different states
Submit your form, add a product to the cart, open pages with URL parameters and check on mobile. Many warnings only appear after an action.
Check the error log
Look at your host's PHP error log or wp-content/debug.log. Frequent entries show which files raise warnings, even when they are hidden.
How to fix it
There are two jobs. First, hide errors from visitors straight away. Second, fix the cause so the log stays clean. Hiding is not a fix on its own, because a fatal error can still break the page.
Edit wp-config.php
Set WP_DEBUG to false, or keep it true but set WP_DEBUG_DISPLAY to false and WP_DEBUG_LOG to true. Place these lines above the 'That's all, stop editing' comment.
Find the source
Read wp-content/debug.log. The file path in each message names the plugin or theme at fault. Update it, replace it, or contact its developer.
Test by deactivating
On a staging copy, deactivate plugins one at a time, or switch to a default theme, to find which one raises the warning.
Set php.ini values
In production set display_errors=Off, log_errors=On and an error_log path. Restart PHP-FPM or Apache after changing it.
Or set values in code or .htaccess
If you cannot edit php.ini, use ini_set at the top of your entry file, or php_flag in .htaccess on Apache with mod_php. Your host may restrict these.
Fix the code
Follow the file and line in the message. Typical fixes: check a variable or array key exists before using it, and handle null values.
Understand the limit
Shopify does not run PHP, so you will not see PHP warnings. Visible code errors there are usually Liquid errors such as 'Liquid error (sections/...)'. Fix them in the theme code editor.
Understand the limit
Wix does not run PHP. If you see PHP text, it comes from an embedded external page or a connected app. Fix it on that host.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );// Before: raises a warning if 'email' is missing
$email = $_POST['email'];
// After
$email = isset( $_POST['email'] ) ? sanitize_text_field( $_POST['email'] ) : '';Before
- Warning text printed above the form
- File paths visible to anyone
- Layout pushed down or broken
After
- Page renders cleanly
- Errors written to a private log
- Underlying bug fixed in code
How to confirm it's fixed
- Reload key pages in a private window and search for 'Warning:', 'Notice:', 'Fatal error:' and '.php on line'
- View page source and search the same terms
- Submit your form and run a test checkout path
- Check the error log: new entries should stop after the fix
- Test on mobile and on the pages that use URL parameters
How to prevent it happening again
- Keep display_errors Off in production and use a log file instead
- Test plugin, theme and PHP version updates on staging first
- Review the error log regularly, or after every update
- Remove abandoned plugins and themes
- Check that your host's PHP version is supported by your plugins before upgrading
- Re-check key pages after every deployment
How FunnelGuard handles this
FunnelGuard detects this issue only partly. During a scheduled journey run, it can check that the page text does not contain error strings you list (a 'text_absent' check). If a listed phrase such as 'Warning:' or 'Fatal error' appears on a step, the check fails and you get one alert, after a re-check from a second region, with a screenshot and a likely cause.
Questions people ask
Why is my website showing PHP warnings?
Your server is configured to print PHP errors into the page, and some code (often a plugin, theme or custom script) is raising a warning. Turn off display_errors and read the log to find the file causing it.
How do I hide PHP warnings on my WordPress site?
In wp-config.php set WP_DEBUG_DISPLAY to false, and optionally WP_DEBUG_LOG to true so errors go to wp-content/debug.log. Then fix the plugin or theme named in the log.
Is it safe to leave PHP warnings visible?
No. Messages expose file paths, plugin names and sometimes database details, and they make your site look broken to visitors. Hide them on live sites and log them privately.
Does hiding PHP errors fix them?
No. Hiding only stops visitors seeing the text. The underlying bug remains and can still break forms or pages, so fix the code that raises the warning.
What is the difference between a PHP warning, notice and fatal error?
Notices and warnings flag problems but PHP keeps running. A fatal error stops the script, so the rest of the page may not load. All three can appear on a page if display_errors is on.
How can I find which plugin causes a PHP warning?
Read the file path in the message or in the error log: it usually contains the plugin or theme folder name. If unclear, deactivate plugins one by one on a staging copy.
Can FunnelGuard detect PHP warnings on my pages?
Partly. It can fail a journey step if the page text contains an error phrase you list, such as 'Warning:'. It does not scan the whole site or read server logs.
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