How to Disable Browser Autocomplete for Form Fields – all fields

/** * Disable form autocomplete for all fields on a specific form * * @link https://wpforms.com/developers/disable-browser-autocomplete-for-form-fields/ */ function wpf_dev_disable_form_autocomplete( $form_atts, $form_data ) { // This check will only form autocomplete for Form #11. // Removing this check would disable autocomplete…Continue reading

How to Perform Field Comparisons Within Your WPForms

/** * Perform Field Comparisons * * @link https://wpforms.com/developers/how-to-perform-field-comparisons-within-your-wpforms/ */ function wpf_dev_compare_fields( $fields, $entry, $form_data ) { // Only run this snippet on the form ID 1000 if ( absint( $form_data[ ‘id’ ] ) !== 1000 ) { return $fields;…Continue reading

How to Add BCC to Email Notifications (for specific form)

/** * Add BCC recipients to specific form email notifications. * * @link https://wpforms.com/docs/how-to-add-bcc-to-email-notifications/ */ add_filter( ‘wp_mail’, function ( $args ) { // Use WPForms_Process object to get the form ID $wpforms_process = wpforms()->process; // Only run this snippet on…Continue reading

How to Defer the reCAPTCHA Script

/** * Defer the reCAPTCHA script until after the page loads * * @link https://wpforms.com/developers/how-to-defer-the-recaptcha-script/ */ function wpf_recaptcha_add_async_defer( $tag, $handle ) { if ( strpos( $tag, ‘recaptcha/api.js?onload=wpformsRecaptchaLoad’ ) !== false ) { $tag = str_replace( ‘ src’, ‘ defer async=”async”…Continue reading

Changing the Cache Time on Your Form Token

/** * Extend cache time on form tokens before today. * * @link https://wpforms.com/developers/how-to-change-the-cache-time-on-your-form-token */ function example_add_longer_token_time_before( $times ) { // Allow the token to persist for 3, 4, and 5 days $times[] = 3 * DAY_IN_SECONDS; $times[] = 4…Continue reading

Disable Password Change Notification

/** * Disable the password change notification email. * – Prevents admin notifications when users change their passwords. */ add_filter(‘wp_password_change_notification_email’, ‘__return_false’);Continue reading

Custom Login Styles

/** * Add custom CSS styles for the WordPress login page. * – Styles include a custom registration button and login field adjustments. */ function add_custom_login_styles() { echo ‘ ‘; } add_action(‘login_head’, ‘add_custom_login_styles’); /** * Disable the language dropdown on…Continue reading