What phone do you have? What messaging app are you using? What version of Android are you on?
With my Nexus 6P on Nougat, I can have the lock screen show all content, hide sensitive content or show no notifications. This can also be adjusted on a per-app basis.