Filter unknown sender message rarely works - like many Apple features today
I've seen numerous threads on this, but they are all closed - so I'm starting another one. All of the ones I'm getting are political. The are not now, and never have been, in my contacts. The basic response from people is that this only works for iMessages, not SMS texts - but Apple doesn't say that. And that's a silly reasons as it is very technically easy to check your contacts and see if an incoming number is there or not. From Apple: Block, filter, and report messages on iPhone - Apple Support
"Filter messages from unknown senders
With iMessage, you can filter messages from unknown senders, and you won’t get notifications from them.
Go to Settings
> Messages, scroll down to Message Filtering, then turn on Filter Unknown Senders.
When this setting is on, you can only see messages from people who aren’t in your contacts when you go to Filters > Unknown Senders.
Note: You canʼt open any links in a message from an unknown sender until you add the sender to your contacts or reply to the message."
iPhone SE, iOS 13