Hornets may be attracted to the nectar or sugar water in your hummingbird feeder. While hornets do have their place in the ecosystem, they can be a real nuisance to hummingbird enthusiasts. They may sting human gardeners or birders or, even worse, chase the hummingbirds away. It's difficult to get rid of hornets once they're well established; the best way of keeping them away is to practice a careful policy of prevention.
Purchase a hummingbird feeder designed not to attract hornets. This includes having a bee guard—a thin membrane that hinders the hornets' access to the nectar—at each feeding port on your hummingbird feeder and not having the color yellow, which tends to attract hornets, anywhere on the feeder.
Keep your hummingbird feeder clean and leak free. Eliminate other potential attractions that might bring hornets to the area by ensuring trash can lids are on tight, keeping pet food inside and making sure there's no standing water or liquid—including pet water bowls—near the feeder.
Change the sugar water in your feeder at least twice a week during warm weather—old sugar water left to ferment will attract hornets and wasps.
Take the hummingbird feeder down for a couple of days the instant you notice hornets feeding at it. Once they stop coming around to look for it—usually within a couple of days—you can put it back up.