Wasps and bees are attracted to the color yellow while hummingbirds are attracted to red. Often red feeders come with yellow plastic flower petals surrounding the drinking hole. Yellow is only there to make the hummingbird feeder more attractive to buyers, not to hummers. Try painting the petals red, but be careful not to get paint too close to, or inside the drinking hole where a hummer’s beak might scrape paint flakes off into the nectar. Be sure the paint is dry before re-hanging the hummingbird feeder.
Some feeders are designed so that hummers must dip deeply for nectar, too deeply for an insect’s proboscis to reach. This type naturally discourages wasps and bees that might smell the nectar but will soon abandon the cause of attempting to get to it.
In other cases people have found that the easiest way to deal with wasps and bees at a hummingbird feeder is to give them their own “feeder” with super-saturated sugar water. This could be something as simple as a shallow plate. Hummingbird nectar is mixed as a 4:1 solution, so be sure the wasp nectar is far sweeter. Move the wasp’s plate away from the feeder a foot each day until it located a good distance away. The insects will gravitate with the sugar-rich plate, leaving the hummingbird feeder to the hummers.
Yet another solution that works for some is to simply relocate the hummingbird feeder once wasps have discovered it. Hummers will find the feeder even if it is several feet away, but wasps and bees will take awhile to catch on. When they do, you can move the feeder again. This solution won’t work for window feeders but can work for yard feeders.
Finally, some people recommend using a tiny dab of castor oil on the petals or tube surrounding the drinking hole. Insects are reluctant to stand on some surfaces, and will be discouraged from the feeder. However, do not get oil in or near the drinking hole. The stance of a wasp or bee is such that oil at the hole is unnecessary, and you want to avoid contaminating the nectar or creating a situation where hummers get oil on themselves or their beaks. Note that oil will run in heat, so apply very carefully – a thin, tiny smear with the fingertip will be sufficient.