Contact Form 7: disable client side validation

Contact Form 7 version 5.6 introduced Schema Woven Validation (SWV). It allows validation rules to be defined once on the server side, and have them take effect on the client side as well (before the form is submitted).

This technique is nice and useful for 99% of users, but some forms aren’t meant to be filled out from top to bottom, so the client side validation can cause jumping. If you, for this or any other reason, wish to disable client side validation, you can do so by adding this code to your theme’s functions.php file:

// Disable CF7 client side validation
add_action('wp_footer', function() {
    ?>
        <script>
            window.addEventListener('load', function () {
                if (typeof wpcf7 !== 'undefined') {
                    wpcf7.validate = (a, b) => null;
                }
            });
        </script>
    <?php
});