How to hook_form_alter() inside paragraph item I would like to edit a field in the node_form of a paragraph item. For normal fields i would use something like the code below to tweak a field called field_p_custom_id (d7)

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    switch ($form_id) {
        // tweak CONTENTTYPE_node_form 
        case 'CONTENTTYPE_node_form':
            // hide custom ID field for all users, even admin (this field should never be changed)
            $form['field_p_custom_id']['#access'] = FALSE;

        break;
    }
}


... but, in the case of a paragraph item, the field_p_custom_id is placed inside a paragraph bundle. I searched inside $form and $form_state, but can't find where to alter this field. (the paragraph item is default not present on the form since it is not required and can be added unlimited times)
For Drupal 8 you can implement hook_field_widget_WIDGET_TYPE_form_alter.

/**  
 * Implements hook_field_widget_WIDGET_TYPE_form_alter().  
 */  
function paragraphs_test_field_widget_entity_reference_paragraphs_form_alter(&amp;$element, &amp;$form_state, $context) {
  if ($element['#paragraph_type'] == 'altered_paragraph') {
    $element['subform']['field_text']['widget'][0]['#title'] = 'Altered title';
  }
} 


see my answer here: How do I alter the behavior of the form fields contained within the paragraph field?