Whenever I write a song on the guitar if I start it on the fifth fret, then all parts of the song start on the fifth fret, The intro riff, the chorus and verse riffs, everything. I'm a self taught guy so I never learned much about theory. Is that "bad practice"?
It is not necessarily bad - see AC/DC, Iron Maiden or Status Quo as examples of bands using very basic chord structures.
That said, it is very limiting to only compose in one key, or one fret position. It is well worth learning modes, keys, and the different positions you can play in.
Actually, if you are stuck in this one pattern, the single best thing you can do is go to a teacher for a few lessons, and they will help you break out of that rut by showing you new things to learn. If you don't have a teacher available, try one of millions of videos on YouTube, or start playing along to different music styles.
There are no iron clad rules to composition. But in my experience what we write is a reflection of what we listen to and copy. You say "...if I start it on the fifth fret, then all parts of the song start on the fifth fret,...". So are you also saying that you have written songs starting on the 3rd fret that move up and down the neck? I think this is important.
It is not a bad practice to stay in one place as long as your ideas fit there. Perhaps the 5th fret represents a comfort zone on the guitar where the tension is just right and the register is also just right. I find that if I'm playing (or writing) a song in E I divide my time between the 12th fret and the 7th, using two standard forms, and rhythm parts heavy on the open E. I don't like just staying on 12. But songs around the 3rd to 7th fret might be comfortable there.
Like the other answer implies, if you are limiting yourself that is not good in the long run, but if the song sound good don't judge it. If you are truly stuck in one position try learning a greater variety of songs to get a feel for the different positions and song structures.