Remove a Control Panel Section
Craft itself is caching this data. Once you've removed those lines from your composer.json file, you'll also need to remove them from the cached plugins.php file in Craft.

Open this file...


  /vendor/craftcms/plugins.php


Then find your plugin. Remove the relevant lines from there, and save the file.



For this reason I actually recommend declaring hasCpSettings and hasCpSection the "old fashioned way"... within your plugin's main PHP file.

Yes, it's possible to declare those values via PHP as well. And if you declare them via PHP, they won't get cached in Craft's plugins.php file.


  https://docs.craftcms.com/api/v3/craft-base-plugintrait.html#property-hascpsection
  https://docs.craftcms.com/api/v3/craft-base-plugintrait.html#property-hascpsettings