Title: Block Malware link?
Last modified: August 12, 2021

---

# Block Malware link?

 *  Resolved [ambern](https://wordpress.org/support/users/ambern/)
 * (@ambern)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/block-malware-link/)
 * Hi there,
    I’m looking for a way to block a specific malware link that’s being
   sent via our contact form using the free version of WPForms. We’ve now receive
   two emails from fake addresses claiming photo copyright infringement containing
   a link to “firebasestorage.googleapis.com” (I won’t include the rest of it) that’s
   known to download trojans and malware onto your computer. We have reCaptcha turned
   on and I’ve just turned on anti-spam protection on all of the forms. Because 
   this has been getting through reCaptcha, I’m wondering if it’s possible to block
   the specific link that’s being sent?
 * Thanks!
    -  This topic was modified 4 years, 10 months ago by [ambern](https://wordpress.org/support/users/ambern/).
      Reason: mispelled word
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fblock-malware-link%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * (@kmacharia)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/block-malware-link/#post-14766335)
 * Hi [@ambern](https://wordpress.org/support/users/ambern/)
 * We don’t currently have a way to block URLs within the form builder but this 
   can be achieved using the code snippet I’ve shared below:
 *     ```
       /*
        * Block the firebasestorage.googleapis.com url on Single Line Text and Paragraph Text form fields
        *
        * @link https://wpforms.com/developers/how-to-block-urls-inside-the-form-fields/
       */
   
       function wpf_dev_check_for_urls( $field_id, $field_submit, $form_data ) {
   
           if( strpos($field_submit, 'firebasestorage.googleapis.com') !== false ) {
               wpforms()->process->errors[ $form_data['id'] ][ $field_id ] = esc_html__( 'This URL is not allowed.', 'wpforms' );
               return;
           } 
   
       }
   
       add_action( 'wpforms_process_validate_textarea', 'wpf_dev_check_for_urls', 10, 3 );
       add_action( 'wpforms_process_validate_text', 'wpf_dev_check_for_urls', 10, 3 );
       ```
   
 * In case it helps, here’s our tutorial with the most common [ways to add custom code](https://developers.wpforms.com/docs/how-to-add-custom-php-or-javascript-for-wpforms/)
   like this.
 * For the most beginner-friendly option in that tutorial, I’d recommend using the
   [Code Snippets plugin](http://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/).
 *  Thread Starter [ambern](https://wordpress.org/support/users/ambern/)
 * (@ambern)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/block-malware-link/#post-14777963)
 * Hey [@kmacharia](https://wordpress.org/support/users/kmacharia/), thank you! 
   I use the code snippets plugin (I’m front-end but I guess we’re all expected 
   to be able to do everything these days) using the common portion in the malware
   links that’s being sent. That’s a great little plugin, very handy! Thanks for
   your time and attention to the matter. I’ll follow up if anything strange occurs.
   
   🙂
 *  Plugin Support [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * (@kmacharia)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/block-malware-link/#post-14797346)
 * Hey [@ambern](https://wordpress.org/support/users/ambern/)
 * Sounds good! Let us know if anything else comes up. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Block Malware link?’ is closed to new replies.

 * ![](https://ps.w.org/wpforms-lite/assets/icon.svg?rev=3254748)
 * [WPForms - Easy Form Builder for WordPress - Contact Forms, Payment Forms, Surveys, & More](https://wordpress.org/plugins/wpforms-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpforms-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpforms-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpforms-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpforms-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpforms-lite/reviews/)

## Tags

 * [bots](https://wordpress.org/support/topic-tag/bots/)
 * [reCAPTCHA](https://wordpress.org/support/topic-tag/recaptcha/)

 * 3 replies
 * 2 participants
 * Last reply from: [Kenneth Macharia](https://wordpress.org/support/users/kmacharia/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/block-malware-link/#post-14797346)
 * Status: resolved