I got some help restoring my site and learned (I’m not a coder myself) that you should leave out the php tags at the beginning and end of that recommended code, that’s what causing the problem. Having done that I managed to change the password protected text.