# Removing suspicious links

**URL:** <https://community.gravityforms.com/t/removing-suspicious-links/10931>\
**Category:** Get Help\
**Tags:** notifications, spam\
**Created:** [October 14, 2021, 5:45pm UTC](https://community.gravityforms.com/t/removing-suspicious-links/10931 "2021-10-14T17:45:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [October 15, 2021, 4:26pm UTC](https://community.gravityforms.com/t/removing-suspicious-links/10931/2 "2021-10-15T16:26:12Z")

</div>

Have a look at this solution which was shared in our forums:

> [@How to block links in text field? \[RESOLVED\]](https://community.gravityforms.com/t/how-to-block-links-in-text-field-resolved/5865/6):
>
> Guys, thanks for your help! Here is the code that worked: // add custom validation to form add\_filter( 'gform\_field\_validation\_74\_7', 'validate\_phone\_74\_7', 10, 4 ); function validate\_phone\_74\_7( $result, $value, $form, $field ) { $nourl\_pattern = '(http|https)'; if ( preg\_match( $nourl\_pattern, $value ) ) { $result['is\_valid'] = false; $result['message'] = 'Message can not contain website addresses.'; } return $result; }

Will that work for you?

---

_[View the full topic](https://community.gravityforms.com/t/removing-suspicious-links/10931)._
