Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Prevent the resubmission browser alert

Prevent the alert resubmission of browser on forms

/*Prevent the resubmission browser alert*/
if ( window.history.replaceState ) {
  window.history.replaceState( null, null, window.location.href );
}