Skip to main content
PHP Blog

Back to all posts

How to Disable Symfony Profiler?

Published on
7 min read
How to Disable Symfony Profiler? image

Best Symfony Tools to Buy in October 2025

+
ONE MORE?

To disable Symfony Profiler, you can follow these steps:

  1. Open the config/packages/dev/web_profiler.yaml file in your Symfony project.
  2. Locate the web_profiler section within the file.
  3. Set the toolbar option to false. This will disable the toolbar that appears at the top of each page when the profiler is enabled.
  4. Set the intercept_redirects option to false. This will prevent the profiler from intercepting and profiling any redirects.
  5. Save the changes to the web_profiler.yaml file.
  6. Refresh your application to see the changes take effect. The Symfony Profiler should now be disabled and no longer appear on your pages.

It's essential to note that these changes should be made only in the dev environment configuration file (web_profiler.yaml) to ensure that the profiler is disabled only in the development environment while it remains enabled in the production environment.

How can I hide Symfony Profiler from only certain user roles?

To hide the Symfony Profiler from certain user roles, you can create a custom event listener in Symfony and conditionally disable the Profiler toolbar based on the user's role.

First, create a new event listener class: