How to block email texts on iPhone 7

I've recently been receiving anonymous bit.ly SMS messages from random emails with attachments of bit.ly ads to purchase products. It ranges from Viagra, to other types of medications, and to marketing apps that require me to input my personal and credit card information. Is there a way to block SMS messages from email addresses? For example, an option to block all messages with the word "bit.ly"? We can do this for emails. I wish we had the capability to do this for text messaging too. Apple should create this feature for those who are being abused by SMS ads. Thanks!
Unfortunately, there isn't a way to filter by keyword as you are hoping for. You could consider going to Settings > Messages, and turn on "Filter Unknown Senders". This will filter out anyone not in your contact list. If you don't typically receive legitimate messages from those not in your contacts, that could achieve the same results.

Original thread: https://forums.imore.com/threads/how-to-block-email-texts-on-iphone-7.382797/