Telescope and Debugbar in production: how to allow, then remove
Both tools are invaluable and both can leak data or slow a site. Here is a short-lived, access-controlled way to use them on a live problem.
Telescope records requests, queries, jobs, mails and exceptions; Debugbar renders a panel in the browser. On production they need a gate, a retention limit and a removal date.
Gate access first
Telescope ships with a gate in TelescopeServiceProvider. Restrict it to a specific email or an IP, never to "any authenticated user" on a site with public registration. Debugbar should stay disabled in production entirely.
Limit what is stored
Telescope writes to the database. Enable only the watchers you need, set prune limits, and run telescope:prune on a schedule. An unbounded Telescope table will fill a small database in a week.
Watch the performance cost
Telescope adds queries and serialisation to every request. Enable it for minutes, not days, and never during a traffic spike — it changes the thing you are trying to measure.
Remove it after
Disable the provider, clear the entries, and confirm the route returns 404. Leaving a debugging tool exposed on production is a data leak waiting to happen: request payloads, session data and emails all pass through it.
Frequently asked questions
Is Debugbar safe in production?
No. It renders configuration and query details in the response. Use it locally and staging only.
What should I use instead on a live incident?
Structured logs with request IDs, a metrics dashboard, and short-lived targeted logging. That is less convenient and far safer.
More on this topic: Performance & SEO articles.
Admin
Related articles
Internal linking: the cheapest SEO work you are not doing
Every important page should be linked from somewhere with descriptive anchor text. It costs nothing and it compounds.
Getting a new site indexed by Google: a checklist that works
Verify Search Console, submit a sitemap, make sure nothing is blocking crawl, and then be patient. Most indexing problems are self...
How to speed up a slow WordPress site without rebuilding it
Hosting, page cache, images and plugins — in that order. Most slow WordPress sites improve dramatically before any theme work.