Bats are vicious monsters from your worst nightmares — if you're a beetle, fly, moth or mosquito. For humans, however, bats tend to be more of a blessing than a curse.

That's partly because many people are cursed, or at least annoyed, by insects. With more bats swooping around at dusk, there are fewer mosquitoes and flies to spread disease, fewer moths to swarm streetlights, and fewer beetles and moth larvae to raid vegetable gardens. Just by keeping crop pests in check, bats save U.S. corn farmers an estimated $1 billion every year. Their value to American agriculture ranges anywhere from $3.7 billion to $53 billion per year overall.

Of roughly 1,200 known bat species, about 70 percent are "microbats" that acrobatically pluck insects from the night. The other 30 percent are mostly tropical and subtropical fruit bats, or "megabats," which also perform vital ecological services in their native habitats by pollinating plants and spreading seeds.

eastern red bat with babies The eastern red bat, an insect-eating microbat native to eastern North America, tends to have three or four babies per year. Mothers roost with their offspring until they're weaned. (Photo: Josh Henderson/Flickr)

Microbats don't just eat insects; they eat them with uncanny efficiency. In one night, a single little brown bat (Myotis lucifugus) may eat 60 medium-sized moths or 1,000 mosquito-sized flies. Bats also suppress pests without insecticides, of course, which often kill beneficial insects like bees, ladybugs and dragonflies.

North America has about 50 native bats, mainly microbats that hibernate in winter. A lot of those face grave danger from white-nose syndrome (WNS), an invasive fungal disease that strikes during hibernation. Having killed millions of bats since 2006, it's now pushing several American species toward extinction. And even without white-nose syndrome, many of the world's bats already suffer from habitat loss, as humans claim key places like hibernacula, feeding grounds or roost trees.

Yet while most people can't do much about disease or deforestation, there are ways we can help bats hang on. Adding a few habitat features can turn a farm or yard into a bat oasis, with resources to boost resilience and help more babies survive. Even in fall and winter, as some bats hibernate, we can prepare refuge for the survivors to use in spring. And since all this saves time and energy for bats, they can focus on important tasks like catching insects — and taking care of their adorable babies.

Here are a few tips for attracting bats to a habitat near you:

Set up a bat house

bat house at sunset Bat houses should be at least 15 feet above the ground to protect against predators. And while many bats naturally roost in trees during summer, they reportedly prefer pole-mounted bat houses over those mounted on trees. (Photo: USDA)

One of the simplest and most effective ways to attract insect-eating bats is to provide a good place for them to roost. Bat houses can take many forms, from small backyard boxes to free-standing towers that support large colonies.

People often build microbat houses on their own, and you can find plans online from groups such as Bat Conservation International (BCI) or the National Wildlife Federation (NWF). Kits and pre-built bat houses are also sold online, but since bats are picky, BCI suggests looking for vendors with its Bat Approved certification.

Although some species hibernate in caves, microbats tend to spend warmer months in trees, where they seek the security of tight spaces — including gaps between a tree's bark and its trunk. That's why the living area inside a bat house is so narrow, since it's designed to mimic the spaces that instinctively appeal to bats.

bats in a bat house Endangered Indiana bats are visible roosting in this bat house — even though it's on a tree. While bats like houses on poles or walls, they'll still occupy a tree-mounted house if it meets their other criteria. (Photo: U.S. Fish and Wildlife Service)

"Bats investigate new roosting opportunities while foraging at night," according to a BCI fact sheet, "and they are expert at detecting crevices, cracks, nooks and crannies that offer shelter from the elements and predators."

Don't bother with bait, BCI warns, since "existing evidence strongly suggests that lures or attractants (including bat guano) will NOT attract bats to a bat house." It's also usually illegal to buy or sell bats, and even if it wasn't, catching and releasing them into a new area is unlikely to work, thanks to their strong homing instincts. Just make sure the house meets several criteria that bats care about, namely:

Construction: Bat houses are typically made of wood with grooves in the interior walls, since bats need a rough, graspable surface to hang from during the day. The best have roost chambers at least 20 inches tall and 14 inches wide, and a 3- to 6-inch landing area near the entrance. Pressure-treated wood isn't recommended. It's best to leave the inside unpainted, but consider exterior paint to keep the house warm.

Temperature: Roost temperature "is probably the single most important factor for a successful bat house," according to BCI. The ideal temperature for mother bats to raise their young is between 80 and 100 degrees Fahrenheit (27 and 38 Celsius), although some species are more flexible than others. Once it's built and caulked, there are two main ways to control heat in a bat house: location and color. Place the house where it will get at least six hours of sunlight per day — facing south, east or southeast in most climates — and paint the outside a dark color to absorb heat.

bat houses on pine trees Depending on climate, natural wood color may be dark enough to keep a bat house warm without painting it. Some people still decide to use decorative paint, though, and Batman symbols are a popular option. (Photo: MNStudio/Shutterstock)

Placement: Location is huge in bat real estate, and not just because of sunlight. Even though bats naturally roost in trees, they're more likely to occupy a bat house if it's on a pole or building. That may be because trees are more accessible for predators, or because branches can get in bats' way as they enter and exit tree-mounted houses. On the other hand, some bats avoid wide open areas for fear of predators like hawks and owls, so it's still good to have trees nearby.

Wherever the house goes, it should be 15 to 20 feet off the ground and away from electric lights. Since bat houses have open bottoms to keep guano from collecting inside, don't place it directly above a window, door, deck or walkway. You could put a tray underneath to catch guano as fertilizer, but never use a bucket or other deep container — any baby bats that fall from their roost could get trapped inside.

Timing: You can set up a bat house any time of year, but spring and early summer are when prospective residents are most likely to visit. Be patient, and allow time for bats to discover and examine the house. If it's still unused after two years, though, try modifying or moving it. According to BCI research, 90 percent of bat houses that attract bats do so within two years, while the other 10 percent take three to five years. And if you're evicting a bat colony from a building — one of the few times bats can be a nuisance — mount a bat house nearby several weeks ahead of time.

Preserve native plants

proboscis bat on a tree in Peru Aside from roosts, native trees can offer life-saving benefits like daytime camouflage, as seen with this proboscis bat (Rhynchonycteris naso) in Peru's Pacaya Samiria National Reserve. (Photo: Ivan Kuzmin/Shutterstock)

Whether you want to attract bats, birds, butterflies or any other native wildlife, be sure to offer a mix of native plants. That's especially important for bats that eat nectar or fruit, since native plants are their primary food source. But it can encourage native insects to congregate, too, which is important for insectivorous bats.

That may seem pointless if your yard is already teeming with bugs, especially if that's why you want bats in the first place, but bats like habitats with diverse diets. And since bats feed after dark, you could also plant night-blooming flowers to attract nocturnal insects like moths. Better Homes and Gardens suggests datura, moonflower, four-o'clock, yucca, evening primrose, night-blooming water lily, night-blooming jessamine, cleome and nicotiana. For more ideas, check out this guide to starting a moonlight garden and this list of native night bloomers.

Native trees are another key feature of good bat habitat. Whether or not you add a bat house, they might provide valuable spots for roosting and resting during the summer. And while some microbats hunker down in caves for winter, a few just hibernate in trees. North America's eastern red bat, for example, overwinters in tree tops, bark crevices and sometimes in brush piles.

Provide a water source

bat drinking water in flight Microbats often use echolocation to find water as well as insects. They usually swoop down to take a drink without landing. (Photo: Dennis W. Donohue/Shutterstock)

Ideal bat habitat is within a quarter mile (0.4 kilometer) of a natural body of water, according to BatHouse.com. That's partly because those are good places to hunt flying insects, but also because chasing moths is thirsty work. This isn't crucial, though, and it's still possible to attract bats even without a lake or pond nearby. A big birdbath or artificial pond could suffice, as could plants with leaves that hold water (although watch out for mosquito larvae during summer).

Bats are known to drink from swimming pools, but that sometimes turns out badly. They normally don't land to drink, instead skimming the surface for quick, mid-flight gulps. They can swim, though, and some microbats even naturally hunt frogs and fish. The problem seems to be high walls on some pools, which block bats (and other wildlife) from climbing out. A small ramp might be enough to save them.

***

Once you've attracted bats, your work is mostly over — but not entirely. There's a good chance the bats will return each year, but if you've given them a bat house, some maintenance may be required after they move out for winter.

"Wasp and mud dauber nests should be cleaned out each winter after bats and wasps have departed," BCI explains. "New caulk and paint or stain may be required after three to five years to guard against leaks and drafts." Bat houses should be monitored at least monthly for issues like predators, overheating, rotting wood or other damage. And, obviously, perform repairs only when the house is vacant.

It's not a good idea to touch or handle the bats themselves, both for their safety and yours. It is a good idea to watch them hunt, however, which tends to start shortly after sunset during their active season. As you watch them swoop and juke overhead, think of all the bug bites and ruined tomatoes they're helping you avoid.

Bats may be monsters, but at least they're on our side.

Russell McLendon ( @russmclendon ) writes about humans and other wildlife.