Clarity as standard. Start a conversation

Plain-English guide

Switching off PHP error display on a live site

Most website owners have seen a strange message on their own site at least once: a line of grey text at the top of a page mentioning a file, a line number and something that failed. It looks harmless, maybe a little untidy. In fact it is the site chatting to strangers about its own insides, and on a live business website that chatter should be switched off.

By Matt Rooney · 17/11/2026 · T19 Digital · 5 min read

The short version

  • Visible errors tell strangers what your site is made of.
  • Errors belong in a private log, not printed on the page.
  • Hiding the message is half the job; fixing the cause is the rest.

What an error message on a live page actually is

When code on your site hits a problem, PHP can do one of two things. It can write a note about it into a private log that only the people running the site can read, or it can print the note straight onto the page for whoever happens to be looking. The second option is handy while a developer is building something. On a live site, it is a leak.

Those messages often include folder paths on the server, the names of plugins and files, sometimes the version of the software running and occasionally details about the database. None of that is a password, but all of it is information. It tells an outsider what the site is made of and where things live, which saves anyone hunting for weaknesses a good deal of effort.

The detail in those messages varies with how the site was set up. Some show a single line; others dump a whole trail of the code that ran before the failure. Either way, the safe assumption is that anything printed on a public page has been read by an automated tool somewhere, because plenty of them roam the web collecting exactly this sort of thing.

Two kinds of harm from one grey line

The first harm is the information itself. Security works partly by not handing out a map, and a visible error is a small piece of the map, published to anyone. The second harm is to trust. A customer who sees a garbled warning above your prices does not think about server paths. They think the site is broken, and possibly that the business behind it is careless.

Neither harm is dramatic on its own, which is why error display often gets left on for years. A developer switched it on to fix something, forgot, and moved on. Or the hosting default shows errors and nobody changed it. The site works, so nobody looks. The free security check spots when PHP errors are shown to visitors, and it appears as one of the findings we go through privately.

There is a third, quieter cost. Search engines read your pages too, and a warning sitting at the top of a page can end up in the snippet shown under your name in the results. A grey line of code is not the first impression you want a potential customer to form before they have even clicked through.

Hiding the message is not the same as ignoring the error

Switching off error display does not make problems vanish. It moves them from the page into a log where they belong. That distinction matters, because an error is usually a sign of something worth fixing: a plugin calling a function that no longer exists, a theme written for an older PHP version, or a form that is quietly failing to send.

So the job is done in two halves. First the setting changes so visitors never see raw errors again. Then we read what the errors were saying and deal with the causes that matter, which often overlap with other findings such as outdated plugins or an old PHP version. Simply muting the warning and walking away would be like taking the battery out of a smoke alarm.

Once the causes are fixed, the log goes quiet. If something new fails later, perhaps after an update, it is recorded privately where whoever looks after the site can find it, rather than announced to every visitor who happens to land on that page at the time.

For example, a bike shop's servicing page

Say an independent bike shop in Preston has a site with a servicing price list and a form to book a bike in. A while ago someone added a plugin to show opening hours, and at some point it started throwing a warning at the top of the servicing page. The owner noticed, assumed it was cosmetic, and has been meaning to ask about it ever since.

In that example, the warning names the plugin, its folder and the full server path. The fix turns error display off for the live site, then looks at the cause: the hours plugin is abandoned and clashing with the current PHP version. It is replaced with a simple maintained option. The page is clean, the booking form is tested, and the re-scan shows the error display finding gone.

Notice what the owner gained beyond the security point. The servicing page is the one customers read just before booking, and it no longer opens with a line of gibberish. A fix that removes something your customers could actually see tends to be the one owners remember.

When this is not the problem to worry about

If your site is on a hosted builder such as Wix or Squarespace, you will not normally see raw PHP errors, and this setting is not yours to manage. Equally, if the errors are a symptom of a site that is broadly failing, with pages breaking and the admin barely usable, turning off display is first aid at best. That kind of site needs a rescue diagnosis to decide whether it can sensibly be saved.

And if you are in the middle of a build with a developer working on a test copy, errors showing on that copy are normal and useful. The rule is about the live site your customers use, not the workshop where things are being made and taken apart.

It is also worth saying that turning display off will not fix a slow site, a site that has dropped out of Google or one where nobody has the logins. Those are separate problems with their own answers, and the website rescue exists for exactly that wider mess.

Turning it off properly

If you suspect your site shows errors, the free security check will tell you whether that is among the findings. Switching off error display is part of the Security fix, along with dealing with the causes that matter, adding missing headers and the rest, all re-scanned at the end. The price starts from £295 + VAT and is agreed before anything changes.

It is one of the quicker items on the list and one of the most satisfying. Most owners are relieved to learn that the grey line was usually a setting left in the wrong position plus an old plugin, rather than anything more sinister, and that both can be put right in the same short piece of work.

Questions we get on this

Does an error message on my site mean I have been hacked?

Not usually. Most visible errors come from outdated plugins, themes or code clashing with a newer PHP version. It is still worth getting checked, because it shows the site needs attention, but it is far more often neglect than intrusion.

Can I switch error display off myself?

Sometimes, through a setting in your hosting panel or a line in a configuration file. The risk is turning it off and forgetting the cause, so the form or page that was erroring keeps failing quietly. If you do it yourself, note what the errors said first.

Will turning errors off hide problems from me?

Not if it is done properly. The errors go to a private log instead of the page. Whoever looks after the site can still read them there, which is where they should have been all along, and they stop being visible to the public.

Why would errors appear if the site seems to work?

Because many errors are warnings rather than failures. The page still loads, but something underneath is using code in a way newer software no longer likes. Left alone, a warning today can become a broken page after the next update.

Three things like this, once a month

What actually changed for small businesses in tech, what to do about it, and the guides we publish. No pitch, and you can leave with one click.

Get your score first

Run the free security check, then decide. The Security fix is from £295 + VAT, fixed price, usually done within a week.