Sometimes the preview button is unnecessary or unwanted in your Drupal installation. To remove the preview button, add this function to a custom module.

In this case, we wanted to remove the button from the node form for a “property” content type.


function digitalstax_customizations_form_alter(&$form, $form_state, $form_id) {
if($form_id=='property_node_form') {
unset ($form['buttons']['preview']);
}
}