Symfony 2 - How to delete a bundle? Symfony 2 - How to delete a bundle? symfony symfony

Symfony 2 - How to delete a bundle?


It is basically the process you have outlined, only in somewhat different order.

  1. delete /src/Test/BlogBundle directory
  2. change /app/config/routing.yml file to remove the bundle routes
  3. remove your new bundle from /app/AppKernel.php
  4. clear cache (either by deleting cache/{$env} or console cache:clear)

If this wasn't installed using a dependency manager - that should be all.


I know I am late to answer this but Symfony has instructions on how to delete the bundle. This is how I delete. You can use the same instructions for other bundles you created and want to remove now.


To delete a bundle in Symfony 3 (and higher) :

Method 1 :

  1. go to composer.json, search & delete the bundle.
  2. run composer update ( it will automatically remove the bundle and clear the cache)

Method 2 :
run composer remove alias/to/your/bundle
f.e : composer remove nesbot/carbon

That's all.