Control Visibility of Paragraph Without Fields I'm preprocessing a paragraph to add a custom form but I'm having trouble with the visibility. I don't need any fields on this paragraph.

If I just add the form to the paragraph the whole paragraph is hidden for anonymous users.

function my_module_preprocess_paragraph__my_paragraph(&amp;$variables) {
  $paragraph = $variables['paragraph'];
  $form = \Drupal::formBuilder()-&gt;getForm('Drupal\my_module\Form\MyCustomForm');
  $variables['content']['form'] = $form;
}


However, if I add a title field to that paragraph everything shows up fine. Is there a way I can get the form to show without having to add fields?
Implement hook_field_widget_alter

It will give control of paragraph fields.

function hook_field_widget_entity_reference_paragraphs_form_alter(&amp;$element, &amp;$form_state, $context) {
  if ($element['#paragraph_type'] == 'xyz') {
    $element['subform']['field_name']['#access'] = FALSE;
  }
}