Answers.Body: <p>Craft itself is caching this data. Once you've removed those lines from your <code>composer.json</code> file, you'll also need to remove them from the cached <code>plugins.php</code> file in Craft.</p>
  
  <p>Open this file...</p>
  
  <blockquote>
    <p>/vendor/craftcms/plugins.php</p>
  </blockquote>
  
  <p>Then find your plugin. Remove the relevant lines from there, and save the file.</p>
  
  <hr>
  
  <p>For this reason I actually recommend declaring <code>hasCpSettings</code> and <code>hasCpSection</code> the "old fashioned way"... within your plugin's main PHP file.</p>
  
  <p>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 <code>plugins.php</code> file.</p>
  
  <blockquote>
    <p><a href="https://docs.craftcms.com/api/v3/craft-base-plugintrait.html#property-hascpsection" rel="nofollow noreferrer">https://docs.craftcms.com/api/v3/craft-base-plugintrait.html#property-hascpsection</a>
    <a href="https://docs.craftcms.com/api/v3/craft-base-plugintrait.html#property-hascpsettings" rel="nofollow noreferrer">https://docs.craftcms.com/api/v3/craft-base-plugintrait.html#property-hascpsettings</a></p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-04T13:57:46.793Z
Answers.Text: Awesome, thank you!
Answers.UserDisplayName: jtenclay
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T22:24:33.253Z
Answers.LastActivityDate: 2018-06-01T22:24:33.253Z
Answers.UserDisplayName: Lindsey D
Body: <p>I've made a new plugin for Craft 3 using <a href="https://pluginfactory.io/" rel="nofollow noreferrer">https://pluginfactory.io/</a>, including everything possible just in case I needed it. Now that my project is coming to a close I'm going back through to take out what I didn't end up needing (I now realize this was not the wisest way). I can't seem to take out the Settings and Control Panel sections, even though my <code>composer.json</code> has:</p>
  
  <pre><code>...
  "extra": {
    "hasCpSettings": false,
    "hasCpSection": false,
  }
  ...
  </code></pre>
  
  <p>I'm not redeclaring those as <code>true</code> anywhere else...is there something else I should do to remove those parts?</p>
  
Tags: <plugin-development><craft3>
Title: Remove a Control Panel Section
ThreadText: # Remove a Control Panel Section
  
  (Asked by: username_0 on 2018-06-01)
  
  I've made a new plugin for Craft 3 using <https://pluginfactory.io/>, including everything possible just in case I needed it. Now that my project is coming to a close I'm going back through to take out what I didn't end up needing (I now realize this was not the wisest way). I can't seem to take out the Settings and Control Panel sections, even though my `composer.json` has:
  
  ```
  ...
  "extra": {
    "hasCpSettings": false,
    "hasCpSection": false,
  }
  ...
  
  ```
  
  I'm not redeclaring those as `true` anywhere else...is there something else I should do to remove those parts?
  
  **Tags:** plugin-development, craft3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-01. Score: 2 | Accepted answer
  
  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>
  
  > **Comments:**
  > **username_0**: Awesome, thank you!  
  
  ---
  
  