Guides

Companion Planting for Pest Control: What Works (and What Doesn't)

Companion planting for pest control, based on extension research: trap crops like Blue Hubbard squash and mustards, flowers that attract beneficial insects, pest-by-pest pairings with the evidence for each, and popular claims that do not hold up.

Updated Oct 2026 · 12 min read · Extension-sourced

Short answer

Companion planting can help with garden pests, but mostly in three specific ways: trap crops that pests prefer (Blue Hubbard squash for squash bugs and cucumber beetles, spicy mustards and arugula for flea beetles), small-flowered plants such as sweet alyssum, dill and cilantro that feed the predators and parasitic wasps that eat pests, and mixed plantings that make crops harder for pests to find. Long online lists of plants that "repel" pests are often not backed by research; marigolds, for example, did not deter Colorado potato beetles in multiple studies.

Pest control is the reason many gardeners try companion planting in the first place, and it is also where the advice gets the most unreliable. Some pairings have real research behind them. Others are repeated from chart to chart without much evidence at all. This guide sticks to what university extension services say works, explains how to set up a trap crop and an insect-friendly border, and flags the popular claims that research does not support. To check whether the plants you choose also get along as neighbors, use our companion planting checker.

How companion plants affect pests

University of Minnesota Extension describes three main ways companion plants can help manage insects:

  • Smell. Plant odors can attract pests, repel them or mask the scent of the crop they are looking for. That is what makes trap crops (plants that pull pests away) and repellent crops possible, and a mix of scents can make insects less likely to land on your vegetables at all.
  • Attracting natural enemies. Predators eat pest insects, and parasitoids (mostly tiny wasps and flies) lay their eggs in them. Flowers give these helpers food and shelter, so they stay in the garden.
  • Visual confusion. Some pests find their host plants by leaf shape or color. A bed full of one crop is easy to find; a mix of heights, colors and textures is harder.

The same source cautions that online charts of pest-repelling plants are not always accurate or backed by research, which is why the table below separates pairings with research support from popular claims without it.

Pest-control pairings: what the research supports

These pairings are summarized from University of Minnesota Extension's review of companion planting research unless another source is named. "Research support" means studies found a benefit; it does not mean a guaranteed result in every garden.

PestCrop to protectCompanion or tacticEvidence
Flea beetlesCabbage family (broccoli, cabbage, kale)A trap crop of "spicier" brassicas such as arugula, mustard or napa cabbageResearch support Well documented as a trap crop; mixing three or more trap species worked better than one
Cabbage looper and imported cabbagewormBroccoli and cabbageThyme, onion and nasturtium near broccoli; marigold, onion and nasturtium near cabbageResearch support Reduced caterpillar damage in an Iowa study
Diamondback mothBrussels sprouts and other cabbage-family cropsSage and thyme nearby; collards as a trap cropSome support Sage and thyme cut moth numbers in a greenhouse study; Virginia Extension gives collards as a trap-crop example
ThripsTomatoesBasil and marigolds interplantedSome support A few field and greenhouse studies show fewer thrips
Squash bugs, cucumber beetles, squash vine borerSquash, zucchini, pumpkins, cucumbersBlue Hubbard squash as a trap crop around the bedResearch support Strong: very attractive to all of these pests in Lincoln University research
Squash bugs and cucumber beetlesSquashNasturtiums and marigolds nearbyResearch support Research support, including an Iowa study showing less damage
AphidsSquash (and most crops)Sweet alyssum and African marigolds, or other small-flowered plantsResearch support More aphid predators and parasitoids; a Florida squash study also saw a slight yield gain
Corn earwormSweet cornFlowering buckwheat, cowpea or sunn hemp alongsideSome support More predators and parasitoids of the earworm
Root-knot nematodesMany vegetablesCertain marigolds grown as a solid planting the season beforeSome support Works as a cover planting; interplanting marigolds among crops probably does not
Colorado potato beetlePotatoesMarigoldsNot supported Multiple studies found no effect, so do not rely on it
Flea beetlesCabbage familyMarigolds or green onions as repellentsNot supported Little research support, and some studies contradict it

Trap crops: give pests something they like better

A trap crop is a plant a pest prefers, grown so the pest gathers there instead of on your main crop. It is a sacrifice, and it only works if you deal with the pests once they arrive. The best-documented home-garden example is Blue Hubbard squash for squash pests.

Blue Hubbard squash for squash bugs, cucumber beetles and vine borers

Research by Lincoln University's IPM program, summarized by University of Missouri IPM, found Blue Hubbard squash very attractive to squash bugs, squash vine borers and both striped and spotted cucumber beetles. Their advice for gardens:

  1. Make the trap plants bigger than the crop

    Transplant 2-week-old Blue Hubbard seedlings at the same time you sow your squash or cucumbers. If you grow the main crop from transplants, set the Blue Hubbard out at least 2 weeks earlier.

  2. Plant enough, in the right place

    For a small garden of about 100 cucurbit plants, the researchers had success with 6 to 8 Blue Hubbard plants at the corners, about 3 to 8 feet from the main crop.

  3. Deal with the pests on the trap plants

    Pests that gather on the trap plants must be removed, or they breed there and move on to your crop. Check the trap plants often and hand-pick bugs and egg masses.

  4. Keep the trap plants healthy

    Water and feed them like the main crop. A stressed or smaller trap plant is less attractive.

University of Connecticut IPM describes a fuller version, a perimeter trap crop that rings the whole planting without large gaps, used together with crop rotation. Both extension sources also describe treating only the trap plants with an insecticide; if you go that route, follow the product label exactly and ask your local extension office what suits a home garden.

Mustards and arugula for flea beetles

Flea beetles chew small shot holes in cabbage-family leaves. University of Minnesota Extension says it is well documented that spicier brassicas, including arugula, mustard, rapeseed and napa cabbage, can serve as flea beetle trap crops, and that a mix of three or more species works better than a single one. Sow a strip of mixed mustards and arugula near (not among) your broccoli, cabbage or kale.

Nasturtiums for aphids

University of Vermont Extension calls nasturtiums a magnet for aphids and suggests planting them a little away from aphid-prone crops such as cabbage and green beans. More in our nasturtium companion plants guide.

Flowers that bring in the pest-eaters

Often the simplest and most reliable approach is to feed the insects that eat pests. Clemson Extension notes that ladybugs, ground beetles, assassin bugs, parasitic wasps, syrphid (hover) flies and others help manage pests, and that small-flowered plants such as sweet alyssum, cilantro, parsley, dill, buckwheat and fennel are especially attractive to the tiny parasitic wasps and flies. University of Minnesota Extension gives syrphid flies as an example: the adults visit many kinds of flowers, and their larvae eat large numbers of aphids.

Penn State Extension groups good insectary plants by family:

  • Carrot family (dill, cilantro/coriander, caraway, fennel): especially attractive to small parasitic wasps and flies.
  • Aster family (yarrow, cosmos, coreopsis, sunflowers, signet marigolds): attract larger predators such as lady beetles and soldier beetles.
  • Legumes (clovers, vetch, fava beans): cover crops that many beneficial insects visit.
  • Mustard family (sweet alyssum, mustards): attract natural enemies of cabbage-family pests, but Penn State suggests planting the mustards themselves away from the garden because they attract pests too.

Clemson also advises avoiding broad-spectrum insecticides in the garden, because they kill these beneficial insects along with the pests, which can let pest numbers rebound.

Popular claims with little support

  • Marigolds keep Colorado potato beetles off potatoes. University of Minnesota Extension says multiple studies have shown this to be untrue.
  • Marigolds or green onions repel flea beetles. The same source finds little research to support this, and some studies contradict it. Use a mustard trap crop instead.
  • Marigolds planted between crops stop nematodes. Certain marigolds do suppress root-knot nematodes, but University of Florida Extension says that works when they are grown as a solid planting, and interplanting them with crops probably does not help. See what marigolds really do.
  • Any plant on a "repels pests" list will protect your crop. Many charts mix tradition, observation and research without saying which is which. Treat pairings as good habits that can tip the odds, not guaranteed pest control.

Put it together: a pest-smart garden plan

  1. Know your likely pests.

    Squash bugs and cucumber beetles on cucurbits, flea beetles and cabbageworms on the cabbage family, and aphids almost everywhere are the usual suspects.

  2. Mix your beds.

    Avoid long blocks of one crop. Pick companions in the checker so mixed beds are also good neighbors.

  3. Add a trap crop where it fits.

    Blue Hubbard at the corners of the squash patch; a strip of mustards and arugula near the cabbage family; nasturtiums a little away from aphid-prone crops.

  4. Edge beds with small flowers.

    Sweet alyssum, dill, cilantro, buckwheat and yarrow along edges and corners feed hover flies and parasitic wasps.

  5. Interplant studied herbs and flowers.

    Basil and marigolds with tomatoes; thyme, onions and nasturtiums near broccoli and cabbage.

  6. Scout weekly and keep it simple.

    Check trap crops and undersides of leaves, hand-pick what you find, and rotate crop families each year.

For which crops get along in general, see our companion planting chart and what not to plant together.

Frequently asked questions

Does companion planting really keep pests away?

Sometimes. University of Minnesota Extension reviews research showing that certain trap crops, flowers that attract natural enemies, and mixed plantings reduce some pests, but many popular pest-repelling claims are not backed by research. Treat it as one tool, not guaranteed pest control.

What is the best trap crop for squash bugs?

Blue Hubbard squash. Lincoln University research found it very attractive to squash bugs, squash vine borers and cucumber beetles. Plant it so it is larger than your main crop, and remove the pests that gather on it.

Do marigolds repel pests?

Not as broadly as often claimed. Studies found marigolds did not deter Colorado potato beetles, and there is little support for marigolds repelling flea beetles. Some research shows benefits with tomatoes (thrips) and squash, and certain marigolds suppress root-knot nematodes when grown as a solid planting.

What flowers attract beneficial insects to a vegetable garden?

Small-flowered plants such as sweet alyssum, dill, cilantro, parsley and buckwheat attract tiny parasitic wasps and hover flies, and aster-family flowers such as yarrow, cosmos and sunflowers attract lady beetles and other larger predators.

What can I plant to keep flea beetles off my cabbage and broccoli?

A trap crop of spicier brassicas such as arugula, mustard or napa cabbage works better than repellent plants, and University of Minnesota Extension notes that a mix of three or more trap species is more effective than one.

Companion checker

Pick your crops, trap plants and flowers, and see which belong in the same bed.

Open it

Sources

Pairings are summarized in our own words from extension-service guidance. Research support for many companion effects is limited, so treat them as good habits, not guarantees.

Related guides