Controlling block page display options programatically On block configuration page we can control the display of the block on three factors:
1. All pages except those listed
2. Only the listed pages
3. Pages on which this PHP code returns TRUE (experts only)

how can it be done programatically in my module file?
i solved it by giving configuration in hook_block_info function

function hook_block_info(){
    $blocks = array();
    $blocks['appendices_page_options'] = array(
        'info' =&gt; t('Appendices Page Options'),
        'status' =&gt; TRUE,
        'theme' =&gt; 'MY_THEME',
        'region' =&gt; 'MY_REGION',
        'weight' =&gt; 0,
        'visibility' =&gt; 1,
        'pages' =&gt; "aboutus/*",
        'custom' =&gt; FALSE
    );

    return $blocks;
}