jQuery(document).ready(function($) { // Target the comment submission form $('#commentform').on('submit', function() { var $submitButton = $(this).find('input[type="submit"], button[type="submit"]'); // Disable the button instantly to block double-clicks $submitButton.prop('disabled', true); // Optional: change the cursor to show it is processing $submitButton.css('cursor', 'not-allowed'); }); });