How to programmatically change settings of input filters and activate them?
If you read the API page for the functions you mentioned in your question, you can easily see that there is a bug(or a feature) that it does not load populate $filter-&gt;filters indeed. 

For a workaround, you could do something like this, with the help of filter_list_format()

$format_id = 'full_html';
$filter_id = 'your_filter';


First, load the format object

$format = filter_format_load($format_id);


Now, since we do not have the $filter-&gt;filters populated, we do so by loading the currently enabled filters. 

$filters = filter_list_format($format_id);
foreach ($filters as $filter_id =&gt; $filter_opts) { //Convert to an array, which is expected by the save function.
  $filters[$filter_id] = (array) $filter_opts;
}


You can now make changes in the filter that you are interested in. 

$filters[$filter_id]['status'] = TRUE; //Enable. 
$filters[$filter_id]['settings']['something'] = 'foobar';


Inject filters to the format we have already loaded. 

$format-&gt;filters = $filters;


Save!!

filter_format_save($format);