Answers.Body: <p><em>If it's safe</em> (AFAIK if the option group isn't part of an extension or the core, doesn't contain any option values, isn't used by any custom fields) you can delete it using the API explorer or a drush command.</p>
  
  <p>On the 'Option Groups' screen, each group has a link to its page of options, of the form <a href="https://www.example.org/civicrm/admin/optionValue?gid=94&amp;reset=1" rel="nofollow">https://www.example.org/civicrm/admin/optionValue?gid=94&amp;reset=1</a> where the group ID is 94.</p>
  
  <p>While logged in with privileges to the webserver directory, in sites/default, do:</p>
  
  <pre><code>drush cvapi OptionGroup.delete id=XX
  </code></pre>
  
  <p>Or go to civicrm/api/explorer, choose OptionGroup / delete, and add &amp;id=XX (where XX is the group ID) to the end of what looks like a URL string below those options, and click Go.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-20T08:40:38.107Z
Answers.Text: will take a look at this shortly - looks perfect for me - thanks :)
Answers.UserDisplayName: Marsh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-20T08:31:35.163Z
Answers.LastActivityDate: 2015-05-20T08:31:35.163Z
Answers.UserDisplayName: DaveFF
Answers.Body: <p>Most of the option groups created by creating a custom field set of type radio / select / checkbox are created automatically.</p>
  
  <p>Deleting the custom field, should also delete the option group IF its not being shared by any other custom fields.</p>
  
  <p>Can you elaborate on how you create "orphaned" option groups</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T18:08:57.860Z
Answers.LastActivityDate: 2015-05-18T18:08:57.860Z
Answers.UserDisplayName: Donald Lobo
Answers.Body: <p>I have tested this - When you go directly to 
  Administer -> system setting -> option groups 
  we have an option of creating new option group this is where the problem is because we don't have a option of deleting the option group at this point and this is also not displayed in the list where we try to use this option group in custom field value </p>
  
  <p>But any option group created using (select / ratio) while creating the custom field works alright </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-19T09:56:20.553Z
Answers.LastActivityDate: 2015-05-19T09:56:20.553Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Body: <p>I'm getting frustrated with googl-ing, and can't find out how to delete/remove option groups.</p>
  
  <p>Anyone have a simple answer?
  Even if I have to go into the DB and remove entries from civicrm_option_group - I just want to know that that is safe.</p>
  
  <p>The groups have been created, but there are no fields, and therefore no data in them - but I can't see how to remove them.</p>
  
  <p><em>edit</em></p>
  
  <p>The option groups were created via <strong>Administer -> system setting -> option groups</strong> and creating the fields, but as Ramesh says, below, there is no "delete" option here, so can't see where to remove them.</p>
  
  <p>Background and workflow issue: I added the option groups because doing so through the Also, backing up Ramesh, groups self delete when they're not being used if they were created via the "adding Custom Data Set field" workflow. Although this names the data set as the question and doesn't give flexability to create re-usable names (the option set "name" is not change-able) </p>
  
  <p>i.e.: </p>
  
  <ul>
  <li><p>custom field (question)= Do you like fish and chips?</p></li>
  <li><p>required option group options (Answer - radio): yes, no, sometimes</p></li>
  <li><p>required option group name: sometimes</p></li>
  <li><p>actual option group name: Do you use CivCRM?</p></li>
  <li>actual option group to use: Do you like fish and chips</li>
  </ul>
  
  <p>Should this last section rather be bought up in Jira (sorry if so - I saw it as a "cause" for the situation happening in the first place) </p>
  
  <p><em>end edit</em></p>
  
  <p>Anyone have some background on how these groups work / interact with the UI?</p>
  
  <p>Thanks,
  Martin</p>
  
  <p>Civi: 4.4.13
  Drupal: 6</p>
  
Tags: <custom-fields>
Title: How do I delete an option group (civicrm_option_group)
ThreadText: # How do I delete an option group (civicrm_option_group)
  
  (Asked by: username_0 on 2015-05-18)
  
  I'm getting frustrated with googl-ing, and can't find out how to delete/remove option groups.
  
  Anyone have a simple answer?
  Even if I have to go into the DB and remove entries from civicrm\_option\_group - I just want to know that that is safe.
  
  The groups have been created, but there are no fields, and therefore no data in them - but I can't see how to remove them.
  
  *edit*
  
  The option groups were created via **Administer -> system setting -> option groups** and creating the fields, but as Ramesh says, below, there is no "delete" option here, so can't see where to remove them.
  
  Background and workflow issue: I added the option groups because doing so through the Also, backing up Ramesh, groups self delete when they're not being used if they were created via the "adding Custom Data Set field" workflow. Although this names the data set as the question and doesn't give flexability to create re-usable names (the option set "name" is not change-able)
  
  i.e.:
  
  * custom field (question)= Do you like fish and chips?
  * required option group options (Answer - radio): yes, no, sometimes
  * required option group name: sometimes
  * actual option group name: Do you use CivCRM?
  * actual option group to use: Do you like fish and chips
  
  Should this last section rather be bought up in Jira (sorry if so - I saw it as a "cause" for the situation happening in the first place)
  
  *end edit*
  
  Anyone have some background on how these groups work / interact with the UI?
  
  Thanks,
  Martin
  
  Civi: 4.4.13
  Drupal: 6
  
  **Tags:** custom-fields
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2015-05-20. Score: 3
  
  If it's safe (AFAIK if the option group isn't part of an extension or the core, doesn't contain any option values, isn't used by any custom fields) you can delete it using the API explorer or a drush command.
  On the 'Option Groups' screen, each group has a link to its page of options, of the form https://www.example.org/civicrm/admin/optionValue?gid=94&reset=1 where the group ID is 94.
  While logged in with privileges to the webserver directory, in sites/default, do:
  drush cvapi OptionGroup.delete id=XX
  
  Or go to civicrm/api/explorer, choose OptionGroup / delete, and add &id=XX (where XX is the group ID) to the end of what looks like a URL string below those options, and click Go.
  
  > **Comments:**
  > **username_0**: will take a look at this shortly - looks perfect for me - thanks :)  
  
  ---
  
  ### Answer by username_2 on 2015-05-18. Score: 2
  
  Most of the option groups created by creating a custom field set of type radio / select / checkbox are created automatically.
  
  Deleting the custom field, should also delete the option group IF its not being shared by any other custom fields.
  
  Can you elaborate on how you create "orphaned" option groups
  
  
  ---
  
  ### Answer by username_3 on 2015-05-19. Score: 1
  
  I have tested this - When you go directly to
  Administer -> system setting -> option groups
  we have an option of creating new option group this is where the problem is because we don't have a option of deleting the option group at this point and this is also not displayed in the list where we try to use this option group in custom field value
  
  But any option group created using (select / ratio) while creating the custom field works alright
  
  
  ---
  
  