Wouldso would one start removing all option names inside a WordPress database starting with a particular prefix?

I'd assume we have to specify a prefix, get all options that start with that prefix, after which remove each option found.

This is a sample from the prefix and Wordpress functions to get and removing options within the database.

$prefix = 'cpt_';
$getOpt = get_option($prefix);
foreach($getOpt as $toDelete){
    $deleteOpt = delete_option($prefix);
        echo 'Failure.';
        echo 'Success.';


You have to create a "whitelist" of all of the variables your wordpress plugin sets (I suppose you're searching in a wordpress plugin un-install script), then just loop through it in the other finish so that you can remove all of them.

Simple things like:

// Somewhere in your plugin, maybe as a class property
$pluginDefinedOptions = array('my_name', 'my_created', 'my_modified'); // etc

// Clear up our settings
foreach($pluginDefinedOptions as $optionName) {

This really is the only method to keep the wordpress plugin code tidy.