7 Plants Gardeners Grow to Support Pest Management

Discover seven pest-deterring plants, from rosemary to marigolds, plus smart pairings, spacing, trap-crop limits, and an IPM plan for real gardens.

By · Reviewed by LeafyPixels Review Board · Published · Updated · 17 min read

Pest-deterring vegetable garden with herbs and flowering companion plants

Planting a fragrant herb beside a tomato or a bright flower at the edge of a vegetable bed can make the garden more diverse, more productive for beneficial insects, and more pleasant to work in. It can also do very little if the plant is in the wrong place, too sparse to matter, or expected to solve a pest problem it was never suited to address.

The seven plants below are worth growing because each offers a useful combination of edible harvests, flowers, scent, habitat, or trap-crop value. Use them as part of integrated pest management (IPM): identify the pest, reduce the conditions that favor it, monitor the crop, and intervene only when the damage justifies it. That approach is more dependable than treating any plant as a living pesticide, and it follows the UF/IFAS approach to natural products, which places cultural, mechanical, biological, and resistant-plant tactics alongside any product use.

What these plants can—and cannot—do for pest control

“Pest-repelling plant” is a convenient phrase, but it covers several different jobs. Aromatic foliage may disrupt the way a flying insect locates a host plant. A flower may feed hoverflies or other beneficial insects whose larvae eat aphids. A trap crop may attract the pest to a plant you are willing to inspect and remove. These are useful mechanisms, but none works equally well in every garden.

The evidence is strongest when the plant is matched to a specific situation. UF/IFAS research on marigolds, for example, describes meaningful suppression of certain plant-parasitic nematodes, while extension and horticultural sources are much more cautious about broad claims that marigolds repel every above-ground insect. Likewise, a strong-smelling herb may help break up a uniform crop, yet it will not stop a caterpillar that is already feeding on a leaf.

The most realistic expectation is lower pest pressure or slower pest buildup, not a pest-free bed. Plant companions where you can harvest or enjoy them even if the pest effect is modest. That way, you still get culinary herbs, flowers, pollinator value, or a useful groundcover while you test the strategy.

Match the plant to the pest before you plant

Start with the pest, not the plant list. Holes in a cabbage leaf suggest a different response from clusters of aphids on a bean shoot, stippling from mites, or wilting caused by root injury. Look under leaves, inspect new growth, and check the soil or roots when symptoms do not fit a chewing insect. If you skip identification, you can spend a season planting the wrong kind of “repellent.”

Garden problemBest-fit companion rolePlants to tryImportant limitation
Aphids and whitefliesTrap crop or beneficial-insect supportNasturtiums, chives, marigolds, thymeInspect the companion; it can become a pest nursery
Cabbage moths and related pestsAromatic border plus predator habitatThyme, rosemary, chives, marigoldsA row cover protects young brassicas more directly
Carrot fliesPungent allium or aromatic borderChives, rosemary, thymeEffects are local and do not replace crop rotation or covers
Root-knot nematodesSpecific marigold cover cropFrench marigolds, selected cultivarsCultivar and nematode species matter; intercropping is weaker
General garden diversityNectar, pollen, and visual disruptionAll seven, plus other flowering plantsMore diversity is not automatically better if plants compete

Scent disruption, habitat, and trap crops

Scent disruption is the least visible mechanism. You are not trying to perfume the whole backyard; you are placing enough aromatic foliage close to the crop that the bed is not one uninterrupted block of the host plant. The result can vary with wind, plant size, pest species, and whether the leaves are actively growing. Treat it as a small pressure-reduction experiment, not a guarantee.

Habitat support is often more dependable as a garden goal. Penn State Extension notes that many beneficial insects feed on pollen and nectar as adults and benefit from a diversity of plants that bloom across the season. Marigold flowers, thyme, rosemary, and chive blooms can contribute to that food supply, but a single flower does not create a stable predator population. Combine bloom periods, shelter, and a light hand with insecticides.

A trap crop has a different rule: you want the pest to find it. Nasturtiums may draw aphids away from a brassica bed, but the plan only works if you scout the nasturtiums and remove or treat the infested foliage before the insects spread back. A trap crop that is planted and forgotten is simply an extra host plant.

A simple bed layout that gives companions a chance

Use a layout that makes the companion visible in the bed without forcing incompatible plants to share every resource. Put rosemary and thyme on a sunny, fast-draining outer edge; they dislike the consistently wet soil that suits basil or mint. Tuck chives into a border or between crop groups, and let nasturtiums trail at the foot of taller crops where their spread will not smother seedlings.

Plant companions at the same time as the crop whenever possible. This follows the practical guidance from BBC Gardeners’ World and gives the bed a chance to develop mixed foliage before pests settle into a dense, single-crop patch. Leave enough space for air movement and harvesting, and keep a simple note of the crop, companion, pest, and date so you can judge the result rather than relying on a memorable anecdote.

1. Rosemary

Rosemary is a strong first choice for a dry, sunny vegetable bed because it is an evergreen, aromatic shrub that earns its space even when no pest-control effect is obvious. Its needle-like leaves release a noticeable scent when brushed, and traditional companion-planting charts pair it with beans, cabbage, and carrots for beetle, moth, and carrot-fly concerns. Use those pairings as a sensible trial, not as a promise that the herb will repel every insect.

Healthy rosemary plant growing in a sunny garden setting

The placement rule is simple: keep rosemary on the drier perimeter of the garden, in full sun and well-drained soil. NC State’s plant profile describes it as drought-tolerant but poorly suited to wet, humid conditions, so do not put it beside a frequently irrigated cucumber or lettuce row just because a chart calls it a companion. A pot near a patio or the end of a raised bed can provide the same scent and harvest access without compromising the moisture needs of the vegetables.

Rosemary flowers also bring bees and other visitors to the garden. Prune lightly after flowering to keep the shrub compact, and avoid cutting it back so severely that it cannot maintain a useful canopy. If your main problem is a heavy caterpillar or beetle outbreak, use hand removal, row cover, or another targeted IPM step; rosemary is a background layer, not the emergency response.

2. Basil

Basil makes a good companion for tomatoes and peppers because it likes the same warm-season window and gives you a harvest while the main crop is growing. Its fragrance is often credited with confusing or discouraging insects, and many gardeners place it around tomatoes for that reason. The more defensible benefit is that basil breaks up bare soil and a tomato monoculture while providing edible foliage and, if allowed to flower, resources for insects.

Basil plants growing beside a vegetable garden crop

Give basil full sun and moist but well-drained soil. NC State describes it as a tender annual that should be planted after frost and notes aphids and Japanese beetles as occasional problems, a useful reminder that a “pest-repelling” plant can be eaten itself. Pinch long stems and flower buds when you want bushier culinary growth; leave some flowers if your priority is supporting pollinators.

Space basil so it does not create a humid wall of foliage around tomatoes. One small plant in a large bed is unlikely to change pest pressure, but a modest group around the crop edge is easy to monitor and harvest. If tomato hornworms appear, inspect stems and undersides of leaves directly; basil will not protect a plant from a caterpillar that has already found it.

3. Mint

Mint is popular on pest-control lists because its sharp scent is noticeable to people and can make a mixed planting less uniform. It is also one of the easiest herbs to grow, which is exactly why it needs a boundary. Spearmint can spread through rhizomes and through stems that root where they touch the soil; NC State recommends a container or a raised bed when you need to control its reach. 3. mint

Use mint as a contained edge plant, not a free-range filler between vegetables. A wide pot sunk into the bed can work if the pot has no cracks or escape routes and you remove stems that lean over the rim. Keep the container close enough to the crop to make the planting useful, but far enough away that mint roots cannot compete with shallow vegetables when it eventually outgrows the pot.

Do not confuse a pot of mint with a mouse or ant-proof garden. Its best practical value is as a harvestable aromatic plant and a way to add structural diversity near a seating area, walkway, or container crop. If aphids are the problem, inspect for lady beetles, lacewings, and hoverfly larvae before spraying; preserving those predators may do more for long-term control than adding another mint plant.

4. Thyme

Thyme is the low-growing choice for the sunny, dry edge where basil and mint would struggle. Common thyme forms a compact mound, has intensely fragrant leaves, and is often suggested for cabbage-family crops and other vegetables. It also blooms for bees and butterflies, so it can play both an aromatic-border and beneficial-insect role.

Flowering thyme growing along a sunny garden edge

Plant thyme in full sun, lean soil, and excellent drainage. NC State describes common thyme as drought-tolerant and best suited to dry, sandy, or rocky conditions; overwatering is more likely to shorten its life than forgetting a watering can for a few days. That makes it a poor match for a wet corner and a strong match for a raised-bed edge, rock garden, or container beside sun-loving vegetables.

Harvest just before flowering if you want the most concentrated culinary aroma, but let at least part of the clump bloom when beneficial insects are a priority. Keep the mound trimmed so it does not obstruct airflow or become a hiding place for slugs at the base of young plants. Thyme can help you build a diverse border, but it will not prevent cabbage caterpillars from crossing an exposed row; add mesh or hand-picking when scouting shows active feeding.

5. Chives and other alliums

Chives bring the onion-family scent to small gardens without taking up much ground. Their narrow leaves fit along borders, beside roses, around carrots, or between crop groups, and their purple flowers are rich in nectar. Traditional companion guidance commonly connects chives and other alliums with aphids, carrot flies, and beetles, while the practical gain is often a mix of pungent foliage, flowers, and a perennial clump that returns.

Chives growing in a compact herb garden border

Plant chives in full sun to partial shade and average, well-drained soil. NC State notes that the plants can be grown in small spaces or containers, divided in spring or fall, and self-seed if flowers are not dead-headed. Clip leaves at the base rather than shearing randomly through the clump, and divide crowded plants when you want to extend the border along a carrot or rose bed.

Use alliums as a local barrier or mixed border, not a force field. BBC Gardeners’ World suggests pungent alliums around carrots because crushed foliage can make it harder for carrot flies to locate the host crop, but the effect is inherently limited by distance, wind, and how much of the bed actually contains the scent. Also check the crop pairing: onions, garlic, and related alliums can compete with or stunt some legumes, so do not follow a pest chart without checking the growing requirements of both plants.

6. Marigolds

Marigolds deserve a more precise explanation than “they repel bugs.” French and African marigolds bring flowers, visual diversity, and beneficial-insect habitat, and certain marigolds have a genuine, species-specific use against root-knot and lesion nematodes. That underground effect is different from a border of flowers keeping tomato hornworms or cabbage moths away.

Bright marigold flowers growing beside edible garden plants

For nematode management, think cover crop, not decorative sprinkle. UF/IFAS explains that marigold roots produce compounds associated with nematode suppression, but the result depends on the marigold species or cultivar, nematode species, soil temperature, and whether the plants occupy the same ground as the later crop. The guide recommends growing marigolds ahead of a susceptible vegetable for at least two months and incorporating them into the same site; UC IPM adds that certain French cultivars are stronger choices, while signet marigolds can be poor or even risky choices for some nematodes.

That distinction changes the planting plan. If you suspect root-knot nematodes—stunting, wilting in otherwise moist soil, or galled roots—submit a soil or diagnostic sample where available and choose a resistant crop or rotation plan as well. UC IPM describes sanitation, resistant varieties, crop rotation, fallowing, and soil solarization as important preventive or suppressive tools. Interplanting a few marigolds beneath a tomato does not replace those measures.

For above-ground pests, use scented marigolds as one flowering border and observe what happens. Gardening Know How notes that evidence for control of many insects is not conclusive and that some newer hybrids have little familiar fragrance. Choose healthy plants, leave room around vegetables, and value the flowers even if the only measurable outcome is more hoverflies and a better-looking bed.

7. Nasturtiums

Nasturtiums are the most useful of these seven when you want a deliberate trap crop. Their round leaves and bright flowers make them easy to find, and aphids often colonize them. That can draw attention away from a nearby brassica or bean crop—but only if you are willing to inspect the nasturtiums and remove heavily infested growth.

Nasturtiums flowering at the edge of a vegetable garden

Choose a bushy variety for a small bed or a climbing type when you have a trellis and space. NC State describes nasturtiums as warm-weather annuals that tolerate poor to average, well-drained soil and full sun, with afternoon shade helpful in very hot summers. Too much fertilizer produces more leaves and fewer flowers, while self-seeding and long stems can let the plant spread into young crops.

Place nasturtiums at the outside edge of a brassica bed, below a taller crop, or in a separate pot positioned where you can see it. Start checking twice a week once aphids appear. If the colony is small and predators are present, leave it long enough to support those beneficials; if the plant is covered in aphids or crawling insects are moving toward the crop, cut and dispose of the affected growth rather than assuming the trap will hold forever.

Planting combinations by target pest

The best combination is the one that uses more than one mechanism without creating a care mismatch. A dry, sunny cabbage edge could hold thyme, rosemary, chives, and a few flowering marigolds. A tomato container might pair basil with a small pot of chives, while nasturtiums occupy a separate pot that can be moved or cut back. The goal is a working arrangement, not a crowded companion-planting chart.

Aphids and whiteflies

For aphids, start by looking for predators before choosing a spray. Nasturtiums can function as a trap crop, while chive and marigold flowers can add nectar and structure around the bed. Penn State Extension lists lady beetles, parasitic wasps, ground beetles, and flower-fly larvae among beneficial insects; a garden that supports them is more likely to regulate small outbreaks than one that is repeatedly treated with broad-spectrum products.

For whiteflies, a mixed border may make the crop less visually uniform, and Gardeners’ World specifically recommends French marigolds beneath tomatoes in greenhouse settings. Still, whiteflies reproduce quickly in warm protected spaces. Inspect leaf undersides, remove badly infested leaves, improve airflow, and use a labeled targeted treatment if monitoring shows the population is increasing.

Cabbage moths, carrot flies, and beetles

Brassicas benefit from a layered approach: cover young plants with insect mesh, keep weeds down, and use thyme, rosemary, chives, or marigolds as border plants if their sun and moisture needs fit. The aromatic border is a supporting tactic; the physical barrier is what stops a flying moth from reaching a tender plant. As the plants grow, check both sides of leaves for eggs and caterpillars so you can remove the pest before damage compounds.

For carrots, interplant or border with chives and other alliums only where the bed remains well drained and easy to thin. Scent disruption is strongest close to the crop and may be reduced when foliage is crushed, harvested, or blown away. Rotate carrot-family crops and remove crop debris after harvest so you are not asking one companion to compensate for a repeating pest cycle.

Bean and beetle pairings need the same honesty. Traditional sources list rosemary, marigolds, and nasturtiums near beans, but all three may bring their own trade-offs: rosemary needs dry soil, marigolds need space, and nasturtiums can attract aphids. If beetles are chewing seedlings, use row cover until flowering, then open the bed for pollination and scout frequently.

Root-knot nematodes

Root-knot nematodes are not an above-ground insect problem that a scented border can solve. They are microscopic soil-dwelling roundworms that enter roots and cause galls. UC IPM describes management as difficult and emphasizes prevention, sanitation, resistant varieties, rotation, and other cultural practices.

Marigolds can be part of a targeted plan when the species, cultivar, timing, and soil match. UF/IFAS reports that African and French marigolds differ in their nematode response and that some varieties can be susceptible to particular nematodes. UC IPM recommends certain French cultivars for specific root-knot and lesion nematode situations, warns against relying on intercropping for strong suppression, and notes that populations can rise again when susceptible crops return.

If plants are repeatedly stunted, do not simply add more marigolds and hope. Confirm the problem if possible, clean soil from tools and shoes before moving between beds, remove infested roots after harvest, and ask a local extension service about resistant varieties and rotation options. Marigolds are most valuable here when they are used as one deliberate soil-management step rather than as a decorative promise.

The pest-control routine that makes companion plants useful

Companion plants are easiest to evaluate when the rest of the garden is doing its share. Give crops the light, water, spacing, and nutrition they need; remove diseased or finished foliage; keep weeds from serving as alternate hosts; and avoid making a dense, humid canopy where pests and diseases can spread. A stressed vegetable is not protected by the presence of a healthy herb beside it.

Scout, verify, and act before damage spreads

Walk the garden at least once a week, and more often during a known pest flush. Check new growth, leaf undersides, flowers, stems, and the soil line. Record the pest and the amount of damage instead of reacting to every insect you see. Some insects pollinate, decompose, or prey on the insects you want gone.

When you find a small, localized problem, start with the least disruptive action that fits it: hand-pick caterpillars and beetles, prune a heavily infested shoot, wash aphids from a sturdy plant, or cover a young crop with mesh. If you use a trap crop, set a calendar reminder to inspect it. A trap crop is a management commitment, not a decorative border.

If the problem keeps increasing, compare the companion bed with an unpaired section or last year’s notes. That simple comparison will not be a controlled scientific trial, but it will keep you from crediting the plant for weather, crop rotation, or a late pest arrival. Replace a companion that competes for water, blocks airflow, or creates more pest habitat than it removes.

Protect beneficial insects if treatment is needed

Natural does not automatically mean harmless. UF/IFAS explains that natural products can still carry risks, can injure plants under hot or stressful conditions, and work best inside an IPM program that also includes sanitation, cultural control, resistant varieties, mechanical removal, and biological control. Follow the product label, confirm that the product is registered for the crop and pest, and avoid improvised detergent or essential-oil mixtures on edible plants.

Timing matters. Do not spray open flowers when bees are actively foraging, and do not coat the entire garden when the pest is confined to one plant. Penn State Extension notes that beneficial insects may be more sensitive than pests to insecticides; protecting them means choosing the narrowest practical treatment and preserving untreated habitat elsewhere in the garden.

The plants in this guide are most useful when they make that low-chemical approach easier: a visible trap crop, a flowering border, an edible aromatic, or a perennial that helps diversify the bed. Their value is cumulative and situational. If you combine them with crop covers, clean tools, resistant varieties, good spacing, and regular scouting, you have a plan that can adapt when one layer falls short.

Conclusion: use plants as one layer of IPM

Rosemary, basil, mint, thyme, chives, marigolds, and nasturtiums all deserve a place in the garden—but not for the same reason. Rosemary and thyme fit sunny, dry edges; basil shares the warm-season rhythm of tomatoes; mint needs containment; chives make a compact aromatic and flowering border; marigolds have a specific nematode-management use when the cultivar and timing are right; and nasturtiums can serve as monitored trap crops.

Choose one plant based on the pest you actually have, place it where its care needs fit, and give it a job you can observe. Then keep scouting. A diverse garden is better protected when its living companions support a larger IPM routine, not when they are asked to do the whole job alone.

Frequently asked questions

Do plants that keep pests away really work?

They can reduce pest pressure, but results depend on the pest, plant density, weather, and placement. Aromatic herbs may disrupt host-plant cues, flowers can support predators, and nasturtiums can act as monitored trap crops. Use companions with scouting, barriers, sanitation, and resistant varieties rather than expecting a pest-free garden.

Which of these plants is best for aphids?

Nasturtiums are the clearest choice when you want a trap crop because aphids often colonize them, making the problem visible and removable. Chives, thyme, and marigolds can also contribute flowers and habitat for aphid predators. Inspect all companion plants regularly; an unattended nasturtium can spread aphids back into the vegetable crop.

Do marigolds repel all garden bugs?

No. Evidence is strongest for certain marigold species and cultivars suppressing specific root-knot or lesion nematodes, especially when grown as a substantial pre-planting crop in the same soil. Marigolds may also add flowers and diversity, but they should not be treated as a guaranteed control for hornworms, cabbage moths, or every other insect.

Can I plant mint directly in my vegetable garden?

It is safer to grow mint in a large container or a contained raised bed because spearmint spreads by rhizomes and by stems that root where they touch soil. Place the container near the crop you want to diversify, remove escaping stems, and do not let mint crowd vegetables or block airflow.

What should I do if companion plants do not stop the pests?

Identify the pest and measure whether damage is increasing, then use the least disruptive effective step: hand-pick insects, prune an infested shoot, add row cover to young crops, improve spacing, or remove a trap crop before pests spread. If treatment is necessary, use a product labeled for that crop and pest, follow the label, and protect flowers and beneficial insects.

How the "7 Plants Gardeners Grow to Support Pest Management" guide is reviewed?

Editorial policyReview board

Written by · Reviewed by LeafyPixels Review Board · Updated September 13, 2026

This "7 Plants Gardeners Grow to Support Pest Management" guide was researched and written by . Recommendations in the "7 Plants Gardeners Grow to Support Pest Management" guide are checked against multiple independent references before publication.

We prioritize sources that hold up under scrutiny:

  • University cooperative extension bulletins and fact sheets (Penn State, Clemson, UMD, NC State, and similar programs)
  • Botanical garden and horticultural society publications
  • Peer-reviewed plant science and veterinary toxicology references where pet safety matters (including ASPCA Animal Poison Control)
  • Established reference works on indoor plant culture

The LeafyPixels editorial team then reviews the draft for clarity, step-by-step usefulness, and fit with real apartment and home conditions-not ideal greenhouse setups. When guidance changes materially, we update the page and note the revision date.


Sources used

  1. BBC Gardeners’ World (n.d.) Companion Planting Combinations. [Online]. Available at: https://www.gardenersworld.com/plants/companion-planting-combinations/ (Accessed: 13 September 2026).
  2. companion-planting charts (n.d.) Companion Planting Guide Zmaz81mjzraw. [Online]. Available at: https://www.motherearthnews.com/organic-gardening/companion-planting-guide-zmaz81mjzraw/ (Accessed: 13 September 2026).
  3. Gardening Know How (n.d.) Using Marigolds To Keep Bugs Away. [Online]. Available at: https://www.gardeningknowhow.com/ornamental/flowers/marigold/using-marigolds-to-keep-bugs-away.htm (Accessed: 13 September 2026).
  4. NC State (n.d.) Ocimum Basilicum. [Online]. Available at: https://plants.ces.ncsu.edu/plants/all/ocimum-basilicum/ (Accessed: 13 September 2026).
  5. NC State (n.d.) Mentha Spicata. [Online]. Available at: https://plants.ces.ncsu.edu/plants/all/mentha-spicata/ (Accessed: 13 September 2026).
  6. NC State (n.d.) Thymus Vulgaris. [Online]. Available at: https://plants.ces.ncsu.edu/plants/all/thymus-vulgaris/ (Accessed: 13 September 2026).
  7. NC State (n.d.) Allium Schoenoprasum. [Online]. Available at: https://plants.ces.ncsu.edu/plants/all/allium-schoenoprasum/ (Accessed: 13 September 2026).
  8. NC State (n.d.) Tropaeolum Majus. [Online]. Available at: https://plants.ces.ncsu.edu/plants/all/tropaeolum-majus/ (Accessed: 13 September 2026).
  9. NC State’s plant profile (n.d.) Salvia Rosmarinus. [Online]. Available at: https://plants.ces.ncsu.edu/plants/salvia-rosmarinus/ (Accessed: 13 September 2026).
  10. Penn State Extension (n.d.) Attracting Beneficial Insects. [Online]. Available at: https://extension.psu.edu/attracting-beneficial-insects (Accessed: 13 September 2026).