Okay, I figured it out. I couldn't find a single SQL command to do everything but this is the process I used to fix this.
- go to the
eav_attribute table of your database and find the
attribute_id of the attribute with the empty values
- go to the
eav_attribute_option_value table and find the attribute options that you want to keep (I had 28 values I did not want to delete, if you have more, this may take some time). If you have multiple options with the same value, you can click on the
option_id and see if it matches to the
attribute_id from step 1 (at least in phpmyadmin)
- once you have your list of
option_ids, you can go to the
eav_attribute_option table and search for all options with the
attribute_id from step 1 (in my case, I had 5428 options), then you can use this command to find how many blank options you have:
SELECT * FROM eav_attribute_option WHERE attribute_id = [attribute_id from setp 1] AND option_id NOT IN (option_id list)
- Verify that this is the data that you want to delete and run the following command:
DELETE FROM eav_attribute_option WHERE attribute_id = [attribute_id from setp 1] AND option_id NOT IN (option_id list)
This deleted the 5400 empty options that I had in my custom attribute. I hope this helps someone else.