I usually don’t share my phone number to unknown persons. But there are some unexpected and unavoidable situations, where I have to give my number to people not familiar to me. And then I frequently receive iMessages on my iPhone. Well, I have to filter those unknown senders. You can also turn off notifications for iMessages from people who are not in your contacts on your iPhone.
What does this feature do? In the Settings app, this feature sort unknown contacts into a separate list, and this is how it filters unknown senders.
How to Turn Off iMessages Notifications from Unknown Senders on iPhone
Note that the feature prevents only iMessage notifications from unknown senders. If a person is not in your contacts and s/he prefers SMS or Messages to communicate to you, your iOS device will always ring and alert you about the notifications.
It goes without saying that the stranger or unknown person would be an iOS user only as s/he will be sending you iMessage on your devices.
Step #1. Launch Settings app on your iPhone → Scroll down and tap on Messages.
Step #2. Tap on Unknown & Spam → Now toggle “Filter Unknown Senders” ON.
Now go to your Messages app, and you will find two columns there: Contacts & SMS on the left and Unknown Senders on the right.
The two columns will be visible only when your iPhone is connected to mobile data or Wi-Fi network.
I wish Apple had rolled out such message filtering for SMS also. Probably, Apple team has to work harder to bring that change. For now, you can restrict iMessage notifications from unfamiliar contacts.
You may also like to refer: