From www.allaboutbirds.org, Cornell Lab of Ornithology.
Hummingbird feeders must be kept clean. Bacteria and mold grow in sugar water, and sugar ferments, so sugar water should never be left out more than 2 or 3 days; change daily in very hot weather.
Clean feeders at least once a week with hot water and a brush. Don’t use soap or a detergent. Or clean feeders by filling with dilute bleach solution, then rinsing thoroughly. Let them air dry before refilling.
Don’t put oil or other sticky substances around feeding ports to deter bees; this can contaminate the nectar. If bees, wasps, or ants are a problem, try moving the feeder. For other solutions see Cornell Lab’s web page on feeders, pests, and predators.
Keep seed feeders clean too. Moldy or decomposing seeds and hulls can make birds sick. Bird droppings and other contaminants may also spread infectious bird diseases.
Clean seed feeders about once every two weeks, more often during times of heavy use, wet weather, if salmonella is in your area, or you’ve seen sick birds in your yard. To clean a seed feeder, take it apart and use a dishwasher on hot setting, or hand wash with soap and boiling water or with a dilute bleach solution (1 part bleach to 9 parts water). Rinse thoroughly and allow to dry before refilling.
Clean the area under feeders. Moldy or spoiled food is unhealthy for birds and outside pets. Seed scattered on the ground can attract rodents.