Is there a way to block spam texts on iphone

How do I permanently block spam text messages?

On Android, you can also stop spam texts by opening the Messaging app and clicking the three dots at the top-right of the screen. From there, click "Settings" and then "Spam Protection." In the following menu, scroll down to the "Enable Spam Protection" setting and activate it.

Why am I suddenly getting spam texts on my iPhone?

Spam messages usually originate from a spammer's getting hold of your cell number, often via data leaks, the sale of personal data or even simply by random number generation. However the spammers got your number spam texts are at best an annoyance, and at worst a downright security hazard.