Instructions apply to devices withiOS 11and later.

Go toNotifications>Messages.

Under Alerts, tapLock Screento disable Message notifications on the lock screen.

Notifications, Messages, Lock Screen radio button in iOS Settings

The blue check mark icon changes to white to indicate it’s disabled.

you could also prevent texts from showing up as banner notifications in the Notification Center.

Exit the configs app.

Messages, Show Previews, and Never in iOS Settings app

ChooseNeverorOffto disable message previews.