Skip to content
Practical Sustainable Gardening for Everyday Living

Press enter to search. Try "rain barrel", "compost", or "native plants".

Natural Pest & Weed Control

Companion Plants That Repel Garden Pests

By Gaurav Nayak
July 8, 2026 5 min read
Marigolds and nasturtiums planted at the ends of vegetable rows.

Companion planting for pest control occupies a strange space. Some specific pairings have measurable effects supported by research. Most popular “pest-repelling” plant claims have not held up to controlled trials. Sorting them is genuinely useful before you plant marigolds expecting them to do something they will not.

This guide focuses on companion plants with documented pest-deterrent effects, the conditions where those effects work, and the popular claims that have not survived research scrutiny.

The companions with real evidence

Five companion plant relationships have measurable pest control benefits in trials.

  • French marigolds (Tagetes patula) for root-knot nematodes. Specific compounds in French marigold roots reduce nematode populations in soil. Most effective when planted as a dense cover crop for a full season; less effective as scattered individuals.
  • Alliums (onions, garlic, leeks) for aphid deterrence. Strong sulfur compounds in allium foliage deter several aphid species. Effect is modest but documented.
  • Aromatic herbs (basil, dill, sage) for general pest confusion. Strong-smelling plants interfere with pest insects’ chemical navigation. Effect is broader but less specific than the others.
  • Trap crops (nasturtium for aphids, blue Hubbard squash for squash bugs). Specific plants attract pests away from valued crops. Sacrifice the trap crop; protect the main crop.
  • Flowering plants for predator insect support. Not direct pest repellent, but the predator insects attracted to flowering plants reduce pest populations significantly.

How marigolds actually work

French marigolds (Tagetes patula) are perhaps the most-cited pest-repelling plant. The science is more nuanced than the folk wisdom suggests.

The pest-reducing effect is real but specific: French marigolds produce alpha-terthienyl in their roots, a compound that reduces root-knot nematode populations. The effect is best when marigolds are planted as a dense cover crop (filling a bed) for a full growing season, then turned into the soil. The compounds work in the soil after the plants are turned in, not while they are growing.

Scattered marigolds among vegetables have a much smaller effect on nematodes (less plant material in the soil) and minimal effect on flying pests. The “marigold deters pests” claim oversimplifies what is actually a specific soil-treatment effect from concentrated planting.

African marigolds (Tagetes erecta) have weaker nematode-deterrent compounds. Most “marigolds” sold for general garden use are hybrids with even less. For the documented effect, plant specifically French marigold (Tagetes patula) as a season-long cover crop.

Allium combinations that work

Onions, garlic, leeks, and other alliums genuinely deter some pests when planted near vulnerable crops.

Best applications: chives planted near roses or apples (aphid deterrence), garlic planted near broccoli or cabbage (cabbage moth deterrence, partial), onions interplanted in vegetable beds (general aphid deterrence).

The effect requires proximity (within 12-24 inches) and is partial rather than complete. A row of garlic does not eliminate aphids; it reduces them by a moderate percentage. Combined with other management strategies, the effect compounds usefully.

Avoid: planting alliums near beans, peas, or asparagus. These crops do not benefit and may show mild growth suppression in proximity to alliums.

A practical scale note: Companion planting effects are typically modest (10-30% reduction in pest pressure). Companion plants enhance an integrated pest management approach; they do not replace it. Expecting marigolds alone to eliminate pests leads to disappointment.

Trap crops: the clever underused strategy

Trap crops attract pests away from the main vegetables. The trap plants are sacrificed; the main crop is protected.

Best documented trap crop relationships:

Nasturtium for aphids. Aphids preferentially attack nasturtium leaves. Plant nasturtium at the perimeter of vegetable beds; aphids gather there rather than on the vegetables. Pull and dispose of heavily infested nasturtium plants as they accumulate aphids.

Blue Hubbard squash for squash bugs and vine borers. These pests prefer blue Hubbard to other squash varieties. Plant a few blue Hubbard plants 20-30 feet from the main squash patch; pull and destroy them when infested to remove the pest population.

Radishes for flea beetles. Plant a row of radishes 5-10 feet from the brassica bed. Flea beetles attack the radishes preferentially. The radishes can be harvested and the beetle eggs in the soil deal with separately.

Mustard for harlequin bugs. Same principle. Plant mustard greens near brassica plantings; the bugs prefer mustard.

The flowering plants that attract predators

The companion plants with the broadest pest control effect are those that attract predator insects. The predators do the pest reduction work.

  • Dill (allowed to flower): attracts parasitic wasps that target caterpillars
  • Yarrow: attracts ladybugs, parasitic wasps, hover flies
  • Alyssum: attracts hover flies whose larvae eat aphids
  • Calendula: attracts hover flies and other beneficials
  • Borage: attracts bees and predator insects
  • Sweet alyssum: low-growing predator-attracting carpet
  • Cosmos: attracts predator insects, easy to grow
  • Anise hyssop: attracts a wide range of beneficial insects

Claims that have not held up

Several popular companion planting claims do not survive controlled trials.

“Plant basil near tomatoes to repel hornworms.” Research finds no measurable effect on hornworm populations. They grow well together for other reasons (similar conditions), but basil does not deter the worms.

“Plant marigolds throughout to repel all pests.” Scattered individual marigolds have minimal effect on most pests. The nematode effect requires dense planting and soil incorporation.

“Plant chives near apples to deter apple scab.” No effect documented; apple scab is a fungal disease unrelated to insect deterrence anyway.

“Plant mint to deter ants.” Mint has some effect but ants typically just walk around the mint plant. Effect is highly localized.

“Plant lavender to deter mosquitoes.” Effect is minimal beyond a few inches of the plant. Mosquitoes can navigate around lavender easily.

Companion planting for pest control works at modest scale when based on documented relationships. French marigolds reduce nematodes (when planted densely). Alliums deter some aphids. Trap crops genuinely pull pests away from main crops. Flowering plants support the predator insects that reduce pest populations. Most other “repellent plant” claims do not survive research scrutiny. Use the proven combinations; skip the elaborate folk charts.

Related reading from the journal

You might also appreciate Dealing With Powdery Mildew Naturally, Deer-Resistant Plants That Don't Look Like Compromises, and Five Pest Myths That Probably Cost You a Harvest from the journal.

Further reading

Trusted references we consulted while researching this piece. All external.

Frequently Asked Questions

How many marigolds do I need to actually affect nematodes?

For the documented nematode-reducing effect, plant marigolds as a dense cover crop (10-12 plants per square foot) for an entire growing season, then incorporate into the soil. Scattered individual marigolds among other plants provide minimal nematode benefit.

Will companion plants eliminate my pest problems?

No. Companion plants are part of an integrated approach, not a standalone solution. Expect pest pressure reduction of perhaps 20-40% from well-planned companion planting, combined with healthy soil, row cover, and beneficial insect support. Total pest elimination is rarely achievable or even desirable.

Do I need to interplant companions, or can I plant them separately?

Some effects require proximity (alliums near aphid-prone crops). Other effects work even with separation (trap crops 5-10 feet away). For most flowering predator-attractants, separate flowering beds within 30-50 feet of vegetables work fine.

What about plants that "guard" other plants?

Mostly folklore. The "plant X always guards Y" framing oversimplifies what are really specific chemical or trap relationships. Read research for the actual mechanism rather than memorizing pairings.

Will companion planting work in containers?

Yes, modestly. A pot of basil near a tomato container has some general predator-attracting effect. The dense-planting effects (marigold nematode reduction) do not really translate to containers. Use companion planting in containers for general beneficial insect support rather than specific pest deterrence.