Plants That Deter Garden Pests: A Practical Guide
Plants that deter garden pests can help, but they are not a force field. Match flowers and herbs to the pest, then build a realistic garden plan.

Can you deter garden pests with just plants? Sometimes—but “deter” is the important word. A well-chosen companion can make a crop harder for an insect to find, provide nectar for a predator, or draw a pest toward a sacrificial plant. It usually cannot stop a large infestation, protect every crop in a bed, or replace a row cover when a caterpillar is already laying eggs.
The most useful way to think about pest-repellent plants is as one layer of an integrated pest management plan. You are designing a garden that is less convenient for the pest and more supportive of the insects, birds, soil life, and growing conditions that keep pest numbers from exploding. The result is often less damage and fewer emergency sprays—not a garden with no insects.
The short answer: plants can lower pest pressure, not guarantee a pest-free garden
Plants help through several different jobs that are often collapsed into the vague phrase “repel bugs.” Aromatic foliage may interfere with host-finding at close range. Flowering herbs may keep hoverflies, lacewings, lady beetles, and parasitoid wasps supplied with nectar. A trap crop may give a pest something more attractive to eat. Mixed plantings can also break up a large block of one host crop.
The distinction matters because each job has a different expectation. A border of lavender several feet away is not the same tool as dill flowering inside a tomato bed, and neither is the same as a dense stand of marigolds grown before vegetables for a diagnosed nematode problem. Washington State University Extension’s evidence review of companion planting makes the same broad point: companion planting is a legitimate horticultural practice, but popular claims often run far ahead of field evidence.
| Garden problem | Plant tactic worth trying | What it can realistically do | What still matters |
|---|---|---|---|
| Aphids and whiteflies | Flowering dill, fennel, cilantro, sweet alyssum, or selected aromatic companions | Feed or shelter natural enemies; sometimes disrupt host-finding | Inspect new growth and wash or remove colonies early |
| Caterpillars on tomatoes or brassicas | Dill and other insectary flowers; basil or thyme as a trial companion | Support parasitoids or reduce some egg-laying behavior | Row covers and hand-picking are more immediate |
| Flea beetles | Very close companion or sacrificial radish; sage or mint as a trial | Give beetles another landing and feeding option | Protect small seedlings with a barrier |
| Carrot fly or leek moth | Intercrop carrots with alliums, or alliums with carrots | Break up a host-crop signal in some situations | Use local timing and cover the crop when pressure is high |
| Root-knot nematodes | A dense, pre-plant marigold cover crop in the same soil | Suppress certain nematodes when species and cultivar match | Test soil; do not expect a flower border to cure roots already infected |
| Slugs, rabbits, deer, or a severe outbreak | Plants alone are a weak first choice | May add habitat or mild friction | Use barriers, habitat changes, removal, or a labeled control |
If you do not know what is eating the plant, do not buy a “repellent” plant yet. Chewed edges, stippling, sticky leaves, holes, wilt, and missing seedlings point to very different pests. A photo, a look under leaves, and a check at dusk can save more time than planting an entire border that targets the wrong insect.
How plants actually influence pests
There are three defensible mechanisms behind plant-based pest management. First, a nonhost plant can disrupt the visual search an insect uses to find a crop. Second, flowers can provide nectar, pollen, shelter, or alternative prey for beneficial insects. Third, certain plants can act as a trap crop or a pre-plant cover crop that changes what happens in the soil.
Scent is real, but the popular version of the story is too simple. Aromatic plants release volatile compounds, and laboratory tests have found some of those compounds unattractive or disruptive to insects. In an open garden, however, air movement quickly dilutes the chemicals. The WSU review notes that field research has not consistently shown that mint, rosemary, basil, or other aromatic plants create a dependable outdoor scent barrier. In some cases, the plants and their flowers can attract pests or affect beneficial insects too.
The stronger garden-scale idea is complexity. When a bed contains several plant shapes, heights, colors, flowering periods, and nonhost leaves, a specialist pest has fewer uninterrupted host plants to colonize. It may still find the crop, but the population can spread more slowly, and natural enemies have more places to feed and shelter. That is why a mixed bed with flowering plants can be more useful than a single row of one strongly scented herb at the edge.

This does not mean every pairing is scientifically proven or that a chart of “good neighbors” is a law of nature. West Virginia University Extension’s companion-planting guidance calls the practice a useful starting point but emphasizes that outcomes vary by region and that gardeners should record successful and failed combinations. Treat a pairing as a small, observable experiment, not a guarantee.
Match the plant tactic to the pest
Aphids and whiteflies.
Aphids and whiteflies are soft-bodied sap feeders that often gather on tender new growth. The plant response that makes the most sense here is not a magical smell; it is a steady supply of beneficial insects. Flowering dill, fennel, cilantro, sweet alyssum, yarrow, and similar plants can provide nectar for hoverflies, lacewings, lady beetles, and parasitoid wasps. Hoverfly larvae and lady beetle larvae can consume many aphids, while parasitoids use aphids or other pests as hosts for their developing young.
Keep those flowers blooming for more than one week. Penn State Extension recommends diverse plantings with something in bloom from early spring through late fall, along with shelter and shallow water. If you grow basil or marigolds beside tomatoes, treat them as supporting plants rather than the main control. Scout the undersides of leaves, and remove a heavily infested shoot before the colony spreads.
Caterpillars on tomatoes and brassicas.
For caterpillars, the useful question is whether a companion can help natural enemies find the bed or reduce egg-laying—not whether its odor will kill a caterpillar. Dill, fennel, cilantro, and sweet alyssum are valuable when allowed to flower because they provide nectar to small parasitoid wasps and other predators. Savvy Gardening’s research-based tomato companion overview also points to thyme and basil as tested partners for reducing some armyworm or hornworm egg-laying and thrips damage, while warning against reducing the explanation to scent alone.
Brassica seedlings still deserve a row cover if cabbage moths are common in your area. A flowering border may support predators later, but it cannot unlay eggs that have already been deposited on the undersides of kale or broccoli leaves. Remove the cover when the crop needs pollination, or use it on crops whose edible part does not depend on insect pollination.
Flea beetles, carrot flies, and other small crop specialists.
Small flying pests often respond to the layout of the crop more than to a plant’s reputation. Gardeners’ World’s companion-planting examples describe mint near brassicas as a possible flea-beetle distraction, alliums paired with carrots and leeks, and sage alongside brassicas. Those combinations are reasonable trials, but the placement has to be close enough to break up the host crop rather than sitting as a decorative hedge at the far end of the yard.
For a young crop, physical protection is usually more reliable. A floating row cover installed before the adult pest arrives can block egg-laying, while a companion plant added after the first generation has colonized is playing catch-up. If you use radishes or another sacrificial crop as a flea-beetle trap, expect the leaves to show damage and decide in advance whether you will remove the trap crop when it becomes crowded with insects.
Root-knot nematodes.
This is the clearest example of why “pest-repellent plant” is an incomplete label. Marigolds can help suppress some plant-parasitic nematodes, but the tactic is a pre-plant cover-crop strategy, not a few flowers scattered around tomatoes. University of Florida IFAS explains that marigold species and cultivars vary, nematode species vary, and some marigolds can host nematodes that make a problem worse.
The conditions are specific: identify the nematode if possible, choose a suitable marigold cultivar, plant densely in the same site, grow it for at least two months before the susceptible crop, and incorporate or remove it according to local guidance. The plants cannot eradicate nematodes, and interplanting a few marigolds among already susceptible crops is not the same treatment. If root galls, stunting, and repeated wilt suggest a nematode problem, a soil or nematode assay is a better first step than a larger seed order.
Plant tactics that are worth using
The best plant choices are the ones that perform a useful garden job even if the pest claim turns out to be weak. Basil is still a harvestable herb, dill still feeds beneficial insects, lavender still supports pollinators, and marigolds still provide color. Choose companions that fit the crop’s light, water, and root space so the experiment does not cost you the harvest.

Aromatic companions can disrupt host-finding
Basil, thyme, sage, rosemary, lavender, mint, garlic, onions, and marjoram are the classic aromatic companions. Their foliage releases volatile chemicals, and their shapes and colors add nonhost surfaces to the bed. The most responsible claim is that they may disrupt or complicate host-finding for particular pests in particular layouts.
Use them as close companions or intercropped rows when the plants have similar growing needs. A rosemary hedge on the garden boundary may be useful as habitat and a windbreak, but it is not a wall that stops insects from flying over the bed. Mint is especially easy to overplant: keep it in a container or a bottomless pot sunk into the soil, and do not let runners turn a pest experiment into a weed-control problem.
Lavender and rosemary also prefer drier, leaner conditions than tomatoes, cucumbers, or basil. If you force them into an overwatered vegetable bed, they may decline before you learn anything about pests. Put the aromatic plants where their care matches the site, then judge their pest effect separately from their survival.
Insectary flowers feed the predators you want to keep
An insectary plant is chosen primarily to support beneficial insects. Dill, fennel, cilantro, sweet alyssum, yarrow, goldenrod, asters, calendula, and signet marigold are useful candidates because their flowers provide accessible nectar or pollen. The goal is not to attract every insect; it is to keep a range of predators and parasitoids present before a pest outbreak reaches its peak.
Let some herbs flower instead of harvesting every stem. Stagger sowing so one plant does not bloom and disappear all at once, and include flowers with different shapes for different mouthparts. Maintain a shallow water source with stones or rough landing spots, and avoid keeping the soil constantly bare and overheated around the flowers. The Penn State beneficial-insect guide notes that adult beneficials often rely heavily on pollen and nectar, while permanent plantings can provide overwintering habitat.
Do not confuse pollinators with pest predators. Bees can improve fruit set, but they are not going to eat aphids. A flower may support both groups, yet the management benefit depends on whether the flowers are visited by hoverflies, lacewings, lady beetles, predatory bugs, or parasitoid wasps as well as bees and butterflies.
Trap crops move damage instead of erasing it
A trap crop is planted to draw a target pest away from the crop you value. It is a deliberate sacrifice. Examples include radishes for flea beetles around young tomatoes, collards for harlequin bugs, cowpeas for southern green stink bugs, and calendula or nasturtium for some aphids. Savvy Gardening’s tomato examples emphasize that trap crops work only when the pest actually prefers the sacrificial plant and when the trap is close enough to matter.
Place the trap where you can inspect it easily, and plant it early enough to be attractive when the target pest arrives. A trap crop that is ignored can become a breeding nursery. Check it on the same schedule as the main crop, remove or treat it according to your local rules, and abandon the tactic if it increases pest numbers in the bed. Never use a trap crop for a pest that moves freely across the entire garden without adding a barrier or removal plan.
Diversity and intercropping make the bed harder to colonize
Intercropping means growing different crops together or in alternating rows rather than planting one large, uninterrupted block. It can make the host harder to locate, reduce the speed at which a pest moves from plant to plant, improve habitat for natural enemies, and use vertical and horizontal space more efficiently. It also introduces competition, shading, irrigation conflicts, and extra harvesting complexity.
Mix crops with different root depths and mature heights, but leave enough air space for the crop to dry after rain. Use a low-growing companion where it will not smother seedlings, and keep vigorous plants such as mint, fennel, or vining nasturtium from burying a slower crop. Diversity works best when it is designed around the plants’ actual needs, not when every available gap is filled.
How to build a plant-based pest plan
A workable plan can be small. One 4-by-8-foot bed with a tomato, basil, dill, and sweet alyssum is a better experiment than six unrelated “repellent” plants scattered around the property. Build the plan in four steps so you can tell what helped.
Identify the pest before choosing a plant
Start with the damage pattern, not the plant name on a nursery tag. Look at leaf undersides, growing tips, stems, soil surface, and the plant at night. Aphids cluster; whiteflies flutter when disturbed; flea beetles leave small shot holes; caterpillars leave frass and ragged chewing; spider mites create stippling and fine webbing; slugs leave slime and irregular night damage.
If the symptom could be drought, disease, herbicide drift, or root damage, pause before adding a pest plant. A companion cannot fix a root problem that only looks like insect injury. When identification is uncertain, use a local extension office, a regional diagnostic service, or a clear close-up photograph rather than relying on a generic “bugs hate this” list.
Assign one job to each companion
Write down what you want the companion to do. “Attract parasitoids” points you toward flowering dill or sweet alyssum. “Sacrifice leaves to flea beetles” points you toward a trap crop. “Break up a brassica row” points you toward a compatible intercrop. “Suppress root-knot nematodes” points you toward a tested pre-plant marigold cover crop, not a marigold border.
If a plant has no useful job beyond an unverified scent claim, give it a low-cost trial rather than redesigning the whole garden around it. A plant that supplies food, shade, mulch, harvest, or beauty even when pest pressure is low is a safer choice.
Place companions where they can affect the crop
The distance rule depends on the job. Intercropped leaves and alternating rows can disrupt host-finding; a distant perimeter may not. Insectary flowers need to be near enough for beneficial insects to use while leaving the crop accessible for scouting. Trap crops must be close enough to attract the target but far enough that you can remove them without brushing the pest into the main crop.
Match water and light before matching scents. Put lavender, rosemary, and thyme in a sunny, well-drained position; keep basil and dill where they can receive regular moisture; contain mint; and avoid a dense companion canopy that traps humidity around tomatoes or cucumbers. Good horticulture is part of pest management because stressed plants are harder to monitor and often more vulnerable.
Monitor, record, and change one variable at a time
Inspect weekly, and inspect more often when seedlings are vulnerable or a known pest is active. Record the date, crop stage, pest count or damage level, companion plant size, weather, and whether barriers or sprays were used. A simple comparison between one mixed row and one similar row without the companion can reveal more than memory can.
Give perennial flowers time to establish, but do not wait a year for a failing annual crop. WSU Extension notes that perennial companion plantings may take a year or two to reach their best effect, while annual companions can provide resources more quickly. If the crop is being damaged now, add an immediate barrier or removal step while the plant-based system develops.
What to do when plants are not enough
When the pest is already established, move through an IPM sequence instead of adding more plants at random. First confirm the pest and estimate whether the damage threatens the plant or harvest. Then remove egg clusters, hand-pick larger pests, prune a heavily infested shoot, rinse a small colony where appropriate, or use a row cover before the next generation arrives.
Correct cultural conditions next. Thin overcrowded growth, water the root zone rather than keeping foliage wet overnight, remove diseased debris, rotate crops when practical, control weeds that can host the pest, and keep ripe or fallen fruit from feeding a new generation. For mosquitoes, eliminate standing water; no border of basil or lavender compensates for a neglected bucket, saucer, gutter, or rain-filled toy.
If a treatment is necessary, use a product labeled for the crop and pest, follow the current label, and choose the least disruptive option that fits the situation. “Natural” does not automatically mean harmless to bees, aquatic life, pets, or beneficial insects. Penn State Extension cautions that many beneficial insects are more sensitive to insecticides than the pests gardeners are trying to control, so broad, repeated spraying can undo the habitat you planted.
Common mistakes that make pest-repellent planting disappoint
The first mistake is expecting a scent wall. In a breezy garden, volatile compounds do not remain at a uniform concentration around every leaf. The second is using a plant for the wrong pest: marigolds may be associated with aphids, nematodes, and pollinators, but that does not make them a treatment for squash bugs or cabbage worms.
Another mistake is planting too few flowers or harvesting them before they bloom. A single basil plant may add flavor, but it cannot support a season-long beneficial-insect community. On the other hand, a dense mass of a single aromatic plant can compete with the crop, harbor unwanted pests, or make scouting harder.
Trap crops fail when the gardener forgets that the trap is supposed to be attractive. If you do not inspect and manage it, you may simply increase the pest population next to the crop you hoped to protect. Likewise, a marigold planted between tomato plants is not the same as the dense, same-site, pre-plant cover-crop sequence used for certain nematodes.
Finally, do not copy a companion chart without checking climate, mature size, invasiveness, and water needs. Gardeners’ World notes that mint is best grown in a pot because it can smother nearby crops. A plant that takes over the bed is not a successful pest-control system, even if its leaves smell strong.
A realistic three-bed example
Imagine a small vegetable garden with three beds and recurring summer pest pressure. In the tomato bed, plant basil and thyme where they will not crowd the stems, allow a few dill or cilantro plants to flower, and add sweet alyssum along the edge. The goal is a mix of harvestable herbs, nonhost foliage, and nectar for beneficial insects—not a promise that hornworms will never appear.
In the brassica bed, place sage or contained mint where it will not shade seedlings, add a flowering insectary nearby, and use a row cover while cabbage plants are small. Inspect the cover and leaf undersides every week. If flea beetles are the main problem, test a close sacrificial planting such as radish, but remove the trap if it becomes a dense, unmanaged source of adults.
In the root bed, try a carrot-and-leek or carrot-and-garlic layout if both crops fit the season and soil. Record whether carrot-fly damage changes compared with last year, and protect the crop if local pressure is high. If the site has a documented root-knot nematode problem, reserve a season or part of a rotation for the appropriate marigold cover-crop method instead of assuming that a few flowering plants will protect the roots.

That three-bed plan is modest on purpose. It gives each companion a job, keeps the crop accessible for scouting, and leaves room for barriers and rotation. If the plants do not reduce damage after a fair trial, you have not lost the whole garden—and you have useful observations for the next season.
Safety, competition, and coexistence
Use correctly identified plants, especially when leaves or flowers will be eaten. An ornamental “marigold” or scented geranium is not automatically a culinary herb, and a plant that is safe for people is not necessarily safe for pets. Keep seed packets and labeled treatments away from children and animals, and ask a local extension service about plants that are invasive or restricted in your region.
The garden also has to work as a plant community. Give tall companions enough spacing that they do not shade sun-loving vegetables, group plants with similar watering needs, and avoid aggressive perennials in small beds. Remove diseased foliage and do not let a trap crop become a seed source or a pest nursery.
Leave some insects alone. A few chewed leaves can be the cost of hosting birds, parasitoids, and pollinators, and a healthy plant can tolerate minor damage. The goal is to keep pest numbers below the level where the crop, harvest, or plant health is threatened. That is a more durable goal than trying to sterilize the garden of every six-legged visitor.
Conclusion
Plants can deter garden pests, but they work best as supporting infrastructure, not as a stand-alone shield. Aromatic herbs may complicate host-finding, mixed plantings can slow colonization, insectary flowers can keep natural enemies in the garden, and trap crops can redirect damage when they are monitored. Marigolds have a particularly useful but narrow role in managing certain nematodes under specific pre-plant conditions.
Start with the pest, choose one plant-based job, place the companion close enough to matter, and keep a record. Add row covers, hand removal, sanitation, crop rotation, or a carefully chosen labeled treatment when the crop needs more protection. That combination is what gardeners can actually use: fewer exaggerated promises, more resilient beds, and a practical response when the plants alone are not enough.



