Step 1: Hit the 3 dots at the top right corner.
Step 2: Tap settings
Step 3: Tap Spam settings
Step 4: Check the Block unknown numbers box.
* NOTE: This will prevent you from getting security code texts from Google and other sites. They use a substantial bank of numbers to send out the texts and unless you have them all in your contacts list they will be blocked and you won't get the text.