I have a rooted VZW HTC One M8 that I'm about to replace. I want to sell it, but I don't want to lose root or S-Off because I think that might be a selling point. I've never actually rooted or wiped a phone, only thing I've done is flash ROMs. I'd like to know, how do I wipe my stuff off this phone to sell it without losing root and S-Off, or is that even possible. I'm still running a 5.0.1 ROM, FluentRom V 6.0, just never have bothered to update to Marshmallow or Nougat with it. Thanks!
What I think you are looking for is this: http://www.htc.com/us/support/htc-one-m8/howto/696022.html
However I am not sure if this removes the root. If it does, there is also another possibility, depending if you have this option. If you already flashed rom's, you may have done it trough fastboot. In the fastboot menu, there should also be an option to delete data (or wipe data) and delete cache. That will delete or your stored files on the phone, without loosing root.