Although most kinds of worms that appear in homes are pretty harmless, all of them, at a minimum, can be a real nuisance. You can try do-it-yourself extermination methods to get rid of these pesky critters.
Make sure that all of your food stores are contained in air-tight jars or storage bins. Some kinds of worms feed on things like grains and fruits, so these worms will go away if they don't have anything to eat. Keep in mind that houseplants and herbs fall into this same category.
Clean your house from top to bottom. This not only removes food crumbs that may serve as a food source, but also gets rid of other household pests and insects like spiders that some worms eat. Regular household cleansers like bleach and borax do wonders, and vacuuming and steam cleaning will kill some kinds of bugs and worms and get rid of eggs. Don't forget to clean your drains and drain guards, especially in the kitchen. Flush your drains with vinegar and baking soda for a safe decontamination once a week and scrub under flaps with an old toothbrush.
Use a dehumidifier, change your HVAC settings and ventilate with open windows. Worms often thrive in warm, damp environments. Your basement probably will be the worst offending room when it comes to bad humidity.
Fill in any gaps or holes that might be allowing the worms to enter. Be careful not to fill any holes purposely left for drainage, as this will worsen the problem by increasing moisture.
Attack the areas that might provide entry with cleansers and insecticide. Diluted vinegar is a natural repellent that works well for worms and other bugs, but sprinkling a line of borax around problem areas also works. Use insecticides last, as manufacturers don't recommend them for indoor use.
Freeze-treat any fabric items that are infested. The cold will kill eggs and worm larvae. Then wash the items thoroughly in very hot water.
Remove any item from the home that still is presenting a problem so that you don't keep reinfesting the home.
Contact your home pest professional. If your home remedies don't work, he will have more powerful treatment methods to assist you.