Garden Plants and Flowers That Help Prevent Pests

Long before chemical sprays and bait stations, gardeners relied on companion planting. By growing certain herbs, flowers, and vegetables alongside their crops helps deter pests away. The science behind why this works varies by plant: some release strong scents that mask the smell pests use to find food, some produce natural compounds that are mildly toxic to insects, and others act as “trap crops” that lure pests away from more valuable plants entirely.

None of these plants replace a proper pest control program especially once a pest infestation is established indoors. For homeowners looking to make their yard naturally less inviting to common pests, the right planting choices can meaningfully reduces the pressure around the home. Companion planting works well as part of a broader prevention strategy, and many of these plants genuinely reduce pest pressure in outdoor spaces. But once pests have already established themselves indoors (within walls, attics, or kitchens) and no amount of garden planting will resolve the infestation. If you are noticing pest activity inside your home despite a well-planted yard, it is a sign the problem has moved beyond what natural deterrents can manage, and a professional inspection is the right next step.

Here is a breakdown plant-by-plant on what each one helps keep away.

Herbs

Basil   [Scientific name: Ocimum basilicum]

Pests it helps deter:  Mosquitoes  •  Houseflies  •  Flea beetles  •  Whiteflies  •  Asparagus beetles

Basil's strong volatile oils are unpleasant to several flying and crawling insects. It is commonly planted in pots around patios and seating areas to create a light barrier against mosquitoes, and tucked beside tomatoes, peppers, and cucumbers to help discourage flea beetles and whiteflies.

Basil Plant

Mint (including peppermint and spearmint)   [Scientific name: Mentha spp.]

Pests it helps deter:  Ants  •  Mosquitoes  •  Mice and rats  •  Fleas  •  Cabbage moths  •  Aphids

Mint's intense scent overwhelms the smell-based navigation that ants and rodents rely on to find food sources which makes it one of the most frequently recommended rodent-deterring herbs. It is best grown in containers rather than directly in garden beds, since mint spreads aggressively and can quickly take over a bed if left unchecked.

Mint Plant

Catnip   [Scientific name: Nepeta cataria]

Pests it helps deter:  Mosquitoes  •  Cockroaches  •  Ants  •  Flea beetles  •  Japanese beetles  •  Squash bugs

Catnip contains nepetalactone, a compound that some research has found to be more effective at repelling mosquitoes than DEET, the active ingredient in most synthetic insect repellents. Like mint, it spreads vigorously and is best contained in pots or a dedicated bed.

Catnip Plant

Rosemary   [Scientific name: Salvia rosmarinusp]

Pests it helps deter:  Cabbage moths  •  Carrot flies  •  Mosquitoes  •  Bean beetles

Rosemary's woody, resinous scent is disliked by several common garden pests. It pairs especially well planted around cruciferous vegetables such as broccoli, cabbage, and Brussels sprouts, where it helps discourage cabbage moths from laying eggs nearby.

Rosemary Plant

Lavender   [Scientific name: Lavandula spp.]

Pests it helps deter:  Mosquitoes  •  Moths  •  Fleas  •  Mice and rats  •  Ticks • Ants

Lavender's calming scent to humans is the opposite for many pests, which rely on strong smells being absent to feel safe foraging nearby. Planting lavender along garden borders, walkways, and near entry points adds a fragrant, low-maintenance perimeter deterrent.

Lavender Plant

Chives  [Scientific name: Allium schoenoprasum]

Pests it helps deter:  Aphids  •  Japanese beetles  •  Carrot flies  •  Cabbage moths

As a member of the onion family, chives release a sulfur-based scent that many soft-bodied insects find overwhelming. They are commonly planted along the edges of raised beds, where they can drape over the side without taking up valuable growing space, and beside carrots, where they help discourage carrot rust flies.

Chives Plant

Flowers

Marigolds   [Scientific name: Tagetes spp.]

Pests it helps deter:  Mosquitoes  •  Aphids  •  Whiteflies  •  Tomato hornworms  •  Root-knot nematodes  •  Rabbits

French marigold roots release a compound called thiophene that is toxic to root-knot nematodes living in the soil, while the flowers themselves release a scent that deters above-ground pests. For nematode protection to be effective, marigolds need to be planted in a dense border or interplanted throughout a bed rather than scattered a few at a time.

Orange Marigolds

Chrysanthemums   [Scientific name: Chrysanthemum spp.]

Pests it helps deter:  Roaches  •  Ants  •  Ticks  •  Fleas  •  Bed bugs  •  Silverfish  •  Root-knot nematodes

Chrysanthemums naturally produce pyrethrin, the same insect-targeting compound found in many commercial insecticides. This gives them one of the broadest pest-deterring profiles of any common garden flower, covering everything from crawling insects to soil-dwelling nematodes.

Orange Chrysanthemums

Nasturtiums   [Scientific name: Tropaeolum majus]

Pests it helps deter:  Aphids  •  Cabbage moths  •  Squash bugs  •  Whiteflies

Nasturtiums work differently than most plants on this list because rather than repelling pests, they act as a “trap crop,” drawing aphids and cabbage moths onto themselves and away from more valuable vegetables nearby. Plant them along the border of a vegetable garden so pests congregate there instead of on your tomatoes or cabbage.

Orange Nasturtiums

Petunias   [Scientific name: Petunia spp.]

Pests it helps deter:  Aphids  •  Tomato hornworms  •  Asparagus beetles  •  Squash bugs

Petunias' sticky stamens physically trap small insects that land on them and killing the pest rather than simply luring it away. They are a popular, low-effort addition to flower beds near vegetable gardens.

Violet Petunias

Daffodils   [Scientific name: Narcissus spp.]

Pests it helps deter:  Mice  •  Rats  •  Squirrels  •  Deer

Daffodil bulbs and foliage contain lycorine, a compound that is unpalatable and mildly toxic if ingested by rodents and other small mammals, which makes daffodils an effective border planting around bulb gardens and vegetable beds that squirrels or mice tend to target.

Yellow Daffodils

Alliums and other strong-smelling plants

Garlic   [Scientific name: Allium sativum]

Pests it helps deter:  Aphids  •  Cabbage worms  •  Carrot flies  •  Slugs  •  Mice and rats

Garlic's sulfur compounds are disliked by a wide range of pests, both above and below ground. Many gardeners plant a perimeter ring of garlic around vegetable beds, then harvest it at the end of the season — getting a full growing season of pest deterrence followed by a kitchen staple.

Garlic

Onions and shallots   [Scientific name: [Scientific name: Allium spp.]

Pests it helps deter:  Aphids  •  Cabbage worms  •  Slugs  •  Japanese beetles  •  Mice and rats

Like garlic, onions and shallots are members of the allium family and share the same pungent, sulfur-based scent that pests find unappealing. They are particularly effective interplanted with carrots, lettuce, and cabbage, which benefit from the same protective effect.

Shallots

Lemongrass and citronella grass   [Scientific name: Cymbopogon spp.]

Pests it helps deter:  Mosquitoes  •  Flies

Citronella grass is the source of the oil used in most citronella candles and natural mosquito repellents, while its close relative lemongrass shares many of the same properties and is easier to find at most garden centres. Planting either near patios, decks, or front entryways creates a natural barrier where people spend the most outdoor time.

Lemongrass
Citronella Grass

Wormwood   Artemisia absinthium

Pests it helps deter:  Ants  •  Flea beetles  •  Cabbage moths  •  Carrot flies  •  Mice  •  Whiteflies

Wormwood is a large, silvery perennial with one of the broadest pest-deterring ranges of any plant on this list deterring both flying insects and small rodents. Its size means it needs dedicated space, and its flowers should be trimmed back before they set seed to keep it from spreading.

Wormwood

Companion planting at a glance

As a quick reference, here is where each plant tends to work best in a typical GTA backyard or vegetable garden:

  • Around patios, decks, and seating areas: basil, lemongrass, citronella grass, lavender
  • Along garden bed borders: chives, garlic, marigolds, chrysanthemums, daffodils
  • Near entry points and foundations: lavender, mint and catnip (in containers), peppermint
  • Interplanted with vegetables: garlic and onions with carrots and cabbage, basil with tomatoes, rosemary with brassicas
  • As a sacrificial trap crop: nasturtiums and petunias planted slightly apart from main crops

An important note on mint, catnip, and pets

A few cautions are worth keeping in mind! Mint and catnip both spread aggressively and are best confined to pots rather than planted directly in garden beds. Daffodil bulbs are toxic if ingested by pets, so they should be kept away from areas where dogs are likely to dig. And while many of these plants are well supported by gardening tradition and some scientific study, results can vary by pest pressure, climate, and how densely the plants are grown. You should think of these plants as one layer of a broader pest prevention strategy rather than a guaranteed fix on their own.

If you find our content useful, please add guardmorepests.com as a preferred source on Google.

Keep Your Home/Business Pest-Free Today

Do you have a pest problem that needs to be looked at right away? Contact Guard More Pest Control about your pests and we'll work on solving your pest problem within 24 hours.