How do I change the default value for a filter? I want to customize the default value for a filter in view through some custom code.
I have tried the below answer and its not working for me.

if ($form['#id'] == 'MY_EXPOSED_FORM_ID') {
// Modifications go here.
// example: (change the field name to yours)
// $form['field_adv_cat_1_tid']['#default_value'] = 'All';


}

How to change views exposed filter default value

And I tried these settings also.

$form_state['input']['field_program_tid'] = '44';
$view-&gt;filter['field_program_tid']-&gt;value = "44";
$view-&gt;exposed_input['field_program_tid'] = "44";


Anyone help me in this?
you can try using hook_form_alter in your custom module.

     function yourmodule_name_form_alter(&amp;$form,&amp;$form_state,$form_id){
//print $form_id to get correct id of the exposed form
    if($form_id == 'views_exposed_form'){
      $form['field_program_tid']['#default_value'] = '44';
//you can unset "all" if you don't need it
      unset($form['field_width_value']['#options']['All']);

     } 
    }