according to traditional chinese medicine, excessive dreaming or nightmares can be a sign of imbalance in the body. can be corrected sometimes with acupuncture and chinese herbal medicine. if you have a lot of stress in your life, reducing it might help. if you have some trauma from your past that you haven't dealt with, talk therapy. there may be some conventional medicine method of dealing with this, but I don't know what it is.
Don't get rid of them - use them - this is how you'll get rid of them. Nightmares have a great potential to help you grow in awareness and change yourself. Often seeming like a dead end road without escape, they nevertheless wake you up - both literally and in the figurative sense. Consider you are the one in charge. Take them as your medicine. If you are familiar with lucid dreaming, you may want to try this way.
I heard something once about being able to control your dreams and nightmares to some extent, but going over them again in the day and changing the ending to a better one. Apparently if you do it everyday, it will effect the way you dream. Who knows. If you believe in Freud's theory - there is something in your subconscious causing bad dreams, so you'd need to figure that out for the to change or cease. If all else fails you could try dreamcatchers
there are all kinds of reasons for nightmares - the symbology of the dream itself is often an indication as to which category/cause it falls into you can try sleeping with a protective stone under your pillow or mattress (onyx, malachite, iolite, etc.), or a quartz crystal near your bed hanging garlic by your bedroom window or putting salt over your windowsills will help, too