I use a bagless vacuum because of allergies. I can't have a bag full of pollen, dust and dirt or whatever is living in my carpet hanging around. I also wash the dirt container and all the plastic pieces after every vacuuming. My husband takes the paper filters outside and blows them out with the air compressor. I also clean the brush off that the hair and threads get wrapped around. It is also a very good idea to clean the hose out too. Hang it somewhere to thoroughly dry before the next use. Or dirt and others nasties get caught in the ribs of the hose.
Maybe you can put some baking soda in the bag each time you change it.