You can block text messages from any number that you don’t want to get any messages from that number.
Blocked number can manage to send you messages, but they don’t know that they are blocked.
In iPhone you can block any of the number that text to you. You can block either number from your contacts or even not saved numbers.
Blocked numbers, they can manage to send you messages, but they don’t know that they got blocked by you.
So, let me me show you , How to do it?
How to Block Text Messages on your iPhone?
1 Open Messages App on you iPhone.
2 Open text messages from the number.
3 Tap on the Contact icon or Number top of the screen.

4 Tap on info icon.

5 Here tap on Block Caller.

Now the selected contact blocked to send you text messages.