Modifying only node forms, not forms appearing in blocks? I have a contact webform in a block in a sidebar that appears on every page. 

I also have some webform nodes. 

I want to use hook_form_alter() to modify the forms that are nodes, not those that appear in blocks. 

How can I differentiate between the two in code?
Using hook_form_formID_alter()

You could use hook_form_formID_alter() to target this Webform node specifically.

For example: 

function hook_form_webform_client_form_429_alter(&amp;$form, &amp;$form_state, $form_id) {
    // Alterations here.
}


webform_client_form_429 in this example is found using the &lt;form id=''&gt; from the node in the block you want to alter.

Using hook_form_alter for all Webforms rendered in a block

If the Webform block was created using webform_block_view() then $form['#node']->webform_block should be TRUE.  Pages on the other hand should be $form['#node']-&gt;webform_block == FALSE

Try using dpm() from the Devel project to poke around the $form variable for webform_block specific items.

My assumption would be that you could use: 

hook_form_alter(&amp;$form, &amp;$form_state, $form_id) {
   if ($form['#node']-&gt;webform_block == FALSE) {
      // Alterations
   }
}