Companion Planting: Nature’s Built-In Bug Repellent

I remember the first time someone told me to plant marigolds around my vegetable garden.
Honestly? I thought it was an old wives’ tale. Like, sure, pretty flowers are going to stop bugs. That sounds great. I’ll just plant some flowers and call it a day.
But I tried it anyway — mostly because marigolds are cheap and I had empty border space to fill. And by the end of that growing season, the difference in pest pressure between my companion-planted beds and my unplanted ones was genuinely shocking.
That was the moment I became a true believer.
What Companion Planting Actually Is (And Why It Works)
Companion planting is the practice of growing certain plants near each other to create mutual benefits — and pest control is one of the biggest benefits of all.
It’s not magic. It’s chemistry.
Many pest-repelling plants release volatile organic compounds — basically strong-smelling chemical signals — through their leaves, roots, and flowers. These compounds either directly repel insects by overwhelming their sensory receptors, or they mask the scent of nearby plants that pests are trying to find.
Some companion plants work differently. Trap crops like nasturtiums attract pests away from your vegetables, concentrating them in one easy-to-treat spot. Others attract beneficial predatory insects — like ladybugs and lacewings — that feed on the pests you’re trying to eliminate.
Think of it as building a whole ecosystem, rather than just fighting individual bugs. And when you combine companion planting with your homemade natural sprays? You’ve got a layered defense system that works around the clock.
The Best Pest-Repelling Plants and What They Actually Do
Not all companion plants are created equal. Here’s a breakdown of the heavy hitters and exactly how they earn their place in your garden.
🌼 Marigolds: The MVP of Companion Planting
Marigolds are probably the most well-researched and widely recommended companion plant in existence — and for good reason.
French marigolds (Tagetes patula) in particular produce a compound called alpha-terthienyl from their roots, which is toxic to nematodes — microscopic soil worms that attack plant roots. Plant them in the ground, not just in pots, so the roots can actually do their work in the soil.
Above ground, their strong scent repels aphids, whiteflies, and thrips. And they attract hoverflies and parasitic wasps — beneficial insects that prey on aphids and caterpillar eggs.
Best planted near: Tomatoes, peppers, squash, cucumbers, and roses.
Pro tip: Plant a dense border of marigolds around your entire vegetable bed, not just a few scattered plants. The more concentrated the scent barrier, the more effective it is.
🌿 Basil: Your Tomatoes’ Best Friend
Basil and tomatoes are the classic companion planting pair — and it goes way beyond just tasting good together in the kitchen.
Basil contains linalool and eugenol, two compounds that are highly effective at repelling thrips, aphids, and tomato hornworms. Some studies have shown that basil planted directly next to tomatoes can reduce aphid populations by up to 60% compared to tomatoes grown alone.
It also repels mosquitoes and flies around your garden space — which is a nice bonus if you like to actually enjoy being outside.
Best planted near: Tomatoes, peppers, oregano, and asparagus.
Plant basil every 12 to 18 inches along your tomato rows for maximum coverage. And don’t be afraid to let a few plants bolt and flower — the blooms attract pollinators and beneficial insects.
💜 Lavender: Beautiful, Fragrant, and Surprisingly Tough on Pests
Lavender is one of those plants that pulls triple duty — it’s gorgeous in the garden, it smells incredible, and it’s a serious pest deterrent.
The linalool and linalyl acetate in lavender are highly effective at repelling moths, fleas, flies, and mosquitoes. Deer and rabbits avoid it too, which is a huge bonus if you’re gardening in suburban areas around cities like Minneapolis or Washington DC where wildlife pressure is real.
At the same time, lavender is a magnet for bees and butterflies — so it actively supports pollination while keeping pests away. It’s genuinely one of the most hardworking plants you can add to your garden.
Best planted near: Roses, brassicas (cabbage, broccoli, kale), and garden borders and pathways.
Lavender thrives in well-drained soil and full sun — it does not like wet feet. If you’re in a rainier climate like Seattle, make sure it’s planted in a raised bed or a spot with excellent drainage.
🌱 Rosemary: The Underrated Pest Fighter
Rosemary doesn’t get nearly as much attention as marigolds or basil in the companion planting world, but it absolutely deserves a spot in your garden.
Its strong, piney scent — produced by camphor and 1,8-cineole — is highly effective at repelling cabbage moths, bean beetles, and carrot flies. If you grow brassicas like cabbage, broccoli, or kale, rosemary nearby is a game changer.
It’s also a perennial in most climates, which means you plant it once and it keeps working for you year after year. That’s a serious return on investment.
Best planted near: Cabbage, broccoli, kale, beans, and carrots.
Rosemary grows into a fairly large shrub over time, so give it space — at least 2 to 3 feet from neighboring plants. It also doubles as a beautiful structural element in garden design, which we’ll get into in a minute.
🌸 Nasturtiums: The Brilliant Trap Crop
Nasturtiums are my secret weapon, and I think they’re one of the most underutilized plants in home gardening.
Here’s the strategy: nasturtiums are irresistible to aphids. They will choose nasturtiums over almost any other plant in your garden. So you plant them as a sacrifice — a trap crop that draws aphids away from your vegetables and concentrates them in one easy-to-treat location.
Once the aphids are clustered on your nasturtiums, you can hit them with a targeted soap spray, remove the affected leaves, or simply let ladybugs and lacewings — which nasturtiums also attract — do the work for you.
Best planted near: Tomatoes, cucumbers, squash, and brassicas.
And here’s a bonus — nasturtiums are completely edible. The flowers have a peppery flavor that’s amazing in salads, and the leaves can be used like watercress. So even your trap crop pulls double duty. 🌸
Pairing Companion Plants With Your Spray Routine
The real magic happens when you combine companion planting with your homemade spray schedule.
Think of it this way: companion plants are your passive, always-on defense, and your natural sprays are your active response when pests break through that first line.
Here’s how I structure it:
- At the start of the season: Do a full garden spray with neem oil emulsion as a preventative, then get your companion plants in the ground
- Weekly maintenance: Spot-check your trap crops like nasturtiums first — if aphids are there, treat them before they spread
- After rain: Reapply your essential oil border spray around the perimeter, since companion plant scents can be temporarily diluted by heavy rainfall too
- When you see pest pressure building: Hit affected plants with a targeted soap or garlic spray while your companion plants continue working in the background
This layered approach means pests are fighting through multiple barriers — the companion plant scents, the spray residue, and the beneficial insects your flowers are attracting. It’s genuinely hard for a pest population to get a foothold when all three are working together.
Garden Design Tips for Making It Look Beautiful
Here’s the thing about companion planting that I absolutely love — done right, it doesn’t just protect your garden. It makes your garden look incredible.
This is where the gardener in you gets to have some real fun.
Border planting: Use marigolds and lavender as a continuous border around your vegetable beds. It creates a defined, colorful edge that looks intentional and designed — not like you just threw some random plants in. This is especially effective in raised bed setups, which are super popular in urban gardens across cities like New York and Chicago.
Height layering: Plant rosemary and lavender at the back of beds as structural anchors, medium-height companions like basil and marigolds in the middle, and low-growing nasturtiums at the front edges where they can spill over beautifully. This creates visual depth and ensures every layer of your garden has pest protection.
Color blocking: Group yellow and orange marigolds together for a bold pop of color, then soften it with the purple of lavender and the bright greens of basil. Think of your garden like a design project — because it absolutely is one.
Pathway planting: Line garden pathways with lavender or rosemary so that every time someone brushes past them, the scent is released. It’s a sensory experience that also happens to deter pests along high-traffic areas.
I’ve seen companion-planted gardens that look like something out of a home design magazine — and they’re also completely organic and pest-resistant. You really don’t have to choose between beautiful and functional.
How Companion Planting Supports Bees, Butterflies, and Beneficial Insects
This is the part of companion planting that genuinely makes me emotional, if I’m being honest.
We talk a lot about keeping pests out of the garden. But what about the insects we want to keep in?
Bees, butterflies, ladybugs, lacewings, and parasitic wasps are all essential to a healthy garden ecosystem. Bees and butterflies pollinate your flowers and vegetables. Ladybugs and lacewings eat aphids, mites, and other soft-bodied pests at a rate that no spray can match — a single ladybug can consume up to 5,000 aphids in its lifetime.
Companion plants are one of the best ways to attract and support these beneficial insects:
- Lavender and basil flowers are rich in nectar and attract bees and butterflies consistently throughout the season
- Nasturtium flowers attract hoverflies, whose larvae are voracious aphid predators
- Marigolds attract parasitic wasps that lay their eggs inside caterpillar larvae — nature’s own pest control
- Allowing herbs like dill and fennel to flower creates umbrella-shaped blooms that beneficial insects absolutely love
The goal is to create a garden that’s so alive with beneficial insect activity that pest populations simply can’t get established. It’s a completely different mindset from conventional pest control — instead of killing everything, you’re building a balanced ecosystem that regulates itself.
And honestly? Watching bees work through a border of lavender on a warm morning while your tomatoes grow pest-free nearby… that’s what organic gardening is really about.
Your garden is becoming a seriously well-defended, beautiful space — and we’re almost at the finish line.
In the next section, we’re pulling it all together with organic garden care tips that prevent pest infestations before they even start — because the best pest control is the kind you never have to do in the first place.
👉 Click the Next button below — because a few simple seasonal habits can make next year’s garden almost completely pest-free from day one. 🐝🌻

GIPHY App Key not set. Please check settings