How to create a "go back" or "cancel" button on the node add form?
Adding '#limit_validation_errors' will help override validation,

$form['actions']['submit_cancel'] = array (
  '#type' =&gt; 'submit',
  '#weight' =&gt; 999,
  '#value' =&gt; t('Delete all input and return to previous page'),
  '#submit' =&gt; array('MYMODULE_userpageredirect_callback'),
  '#limit_validation_errors' =&gt; [],
);