Kitchen Pest Control: How to Get Rid of Ants, Roaches, Pantry Moths and Gnats

Written by Sara Ibrahim. Sara researches home and kitchen products for Cupindy. · Last updated September 28, 2026

Bugs in the kitchen are rarely a cleaning problem alone. Ants, pantry moths, drain flies, German cockroaches and mice each come for something different, and the fix that ends one of them does nothing for the next. So this guide goes pest by pest: how to tell what you have, how to get rid of it, and how to keep it out, using advice from university pest management programs (UC IPM and the University of Tennessee), the CDC and the National Pesticide Information Center, checked in September 2026. We compared those sources and the product listings; we didn't test these products ourselves.

Quick answer: how to get rid of bugs in the kitchen and keep them out

  • Name the pest first. Ants, pantry moths, small flies, roaches and mice need different fixes. The quick guide below helps you tell them apart.
  • Take away what it eats. Crumbs and grease, open packs of flour and cereal, overripe fruit, the slimy film inside your drain, and a trash can without a lid.
  • Use baits and traps, not sprays. University pest experts say sprays give short-term relief at best, and for ants and roaches they can scatter the problem. Sprays near food also add pesticide where you cook.
  • Close the way in. Caulk cracks, pack gaps around pipes with steel wool and caulk, and keep food in hard containers with tight lids.

As an Amazon Associate we earn from qualifying purchases. This doesn't change which products we recommend.

TERRO T300B liquid ant bait stations, 12 pack

Our pick for ants, the kitchen pest people search about most

TERRO T300B Liquid Ant Bait Stations (12)

Ready-to-use borax bait in closed stations. Worker ants carry it back to the nest, which is how you reach the queens. No spraying near your food.

See the TERRO bait stations on Amazon

Moths in the pantry instead? See Dr. Killigan's pantry moth traps

Which kitchen pest do you have?

Match what you're seeing to one of these five, then tap through to the full fix for that pest. Each card shows the one product we would buy first.

As an Amazon Associate we earn from qualifying purchases.

Most searched

Ants

You see: A line of ants along the counter, sink edge or window sill

It wants: Sugar, grease, crumbs and water

First fix: Wipe the trail with soapy water, then set bait on it

TERRO liquid ant bait stations

TERRO Liquid Ant Bait Stations

Read the full fix

See the ant bait

Pantry moths and beetles

You see: Small moths near the pantry at dusk; webbing or tiny beetles in flour, cereal or rice

It wants: Flour, grains, cereal, nuts, dried fruit, spices, pet food

First fix: Throw out infested packs, vacuum, store food in hard containers

Dr. Killigan's pantry moth traps

Dr. Killigan's Pantry Moth Traps

Read the full fix

See the moth traps

Gnats, sink flies and fruit flies

You see: Tiny flies around the sink, fruit bowl, trash or houseplants

It wants: Drain film, overripe fruit, damp potting soil

First fix: Find where they breed and remove it; trap the adults

Zevo plug-in flying insect trap

Zevo Flying Insect Trap

Read the full fix

See the fly trap

German cockroaches

You see: Roaches at night; pepper-like droppings in hinges, under the sink, behind appliances

It wants: Crumbs, grease, water and warm, tight cracks

First fix: Check with sticky traps, then use gel bait in cracks

Advion cockroach gel bait tubes

Advion Cockroach Gel Bait

Read the full fix

See the roach gel

Mice

You see: Droppings in drawers, gnawed packages, noises at night

It wants: Food and a warm way in

First fix: Seal gaps around pipes, then set snap traps

Tomcat Press N Set snap mouse traps

Tomcat Press 'N Set Mouse Traps

Read the full fix

See the snap traps

How to get rid of ants in the kitchen

The ants on your counter are foragers from a nest that is usually outside or inside a wall. They follow a scent trail to food and water, and every ant you wipe away is a tiny share of the colony. So the fix has to reach the nest, not just the ants you can see.

  • Skip the spray. UC IPM, the University of California's pest management program, notes that spraying ants indoors won't prevent more ants from coming in.
  • Wipe the trail with soapy water. Soap removes the scent trail that leads other ants to your kitchen. Do this at the entry point too, but leave the ants that are feeding at a bait station alone.
  • Bait where they walk. A slow-acting bait is carried back to the nest and shared, which is how it reaches the queens. A fast killer stops that from happening.
  • Seal and store. Caulk the cracks they come through, and keep sugar, honey, cereal and pet food in sealed containers, not plastic bags or open packs.
  • Tiny ants near the sink? The same plan works. The TERRO label covers the common small household ants, including little black, odorous house and pavement ants.
  • Give it time. Expect more ants at the bait for a few days. TERRO says full control can take two to four weeks, depending on the size of the colony.
TERRO T300B liquid ant bait stations, 12 pack

Our pick for ants

TERRO T300B Liquid Ant Bait Stations, 12 pack

A ready-to-use liquid bait with 5.4% borax inside small plastic stations, so there is nothing to mix or spill. The label lists common household ants, including odorous house, pavement, little black and ghost ants. Put one on each trail you see, near where the ants come in.

Worth knowing: borax is a pesticide, so place stations where children and pets can't reach them and keep them off the surfaces where you prepare food. UC IPM also notes that prepackaged stations are weaker against very large Argentine ant invasions, because foragers can die before they share the bait. If ants are still coming after a few weeks, that is the time to call a professional.

See the TERRO bait stations on Amazon

As an Amazon Associate we earn from qualifying purchases.

Pantry moths and pantry bugs (flour bugs and weevils)

Pantry pests live inside the food itself, so a clean shelf alone won't end them. The usual culprits are the Indianmeal moth and a group of small beetles: sawtoothed grain beetles, red and confused flour beetles, and cigarette and drugstore beetles. They usually come home inside a package from the store, then spread to other open food. This is the clear-out that university pest programs recommend.

  1. Check every dry food. Flour, rice, pasta, cereal, nuts, dried fruit, spices, pet food and birdseed. UC IPM advises throwing out anything with the slightest sign of pests: webbing, clumps, tiny holes or live insects. Bag it and take it outside.
  2. Vacuum, then wash. Use a crevice tool on shelf corners and cracks to remove eggs and pupae, then wash the shelves with soap and water. Empty the vacuum outside.
  3. Freeze what you want to keep. The National Pesticide Information Center says a week in the freezer kills eggs and larvae. Rarely used flour and spices can simply live in the freezer.
  4. Move food into hard containers with tight lids. UC IPM is clear that plastic bags aren't enough. Moth larvae and beetles can work their way into paper bags and thin packaging.
  5. Hang a pheromone trap to check your work. These traps attract male moths only, so they tell you whether moths are still around. They don't clear the food that is feeding them.
Pantry shelf with flour, rice and pasta in clear airtight containers that keep pantry moths and beetles out

Hard containers with tight lids keep pantry pests out of the food and make any new webbing easy to spot.

One thing not to do: spray the pantry. UC IPM says insecticides aren't recommended for any pantry pest, and cleaning, freezing and good containers do the job. If you're choosing containers, our guide to which plastics are fine for food storage explains the numbers on the bottom, and our pantry organization guide helps you set the shelf up so old food doesn't hide at the back.

Dr. Killigan's pantry moth pheromone traps, 6 pack

Our pick for checking pantry moths

Dr. Killigan's Pantry Moth Traps with Pheromones, 6 pack

Sticky traps with a pheromone lure for Indianmeal moths. No spray and nothing that touches food. The brand suggests three at a time, one in the pantry and two around the kitchen, and says each lasts up to three months.

Worth knowing: they catch male moths only, so treat them as a check, not a cure. If you keep catching moths after the clear-out, there is still infested food somewhere. Go through the shelves again, including pet food and birdseed.

See Dr. Killigan's traps on Amazon

As an Amazon Associate we earn from qualifying purchases.

Vtopmart clear airtight food storage containers with locking lids, 24 pieces

Our pick for everyday pantry storage

Vtopmart Airtight Food Storage Containers, 24 pieces

Clear, stackable containers in four sizes, with side-locking lids and silicone gaskets, so you can see at a glance if anything is wrong. The listing says they are BPA-free plastic, and they come with reusable labels.

Worth knowing: they are for dry goods, not leftovers. Take the silicone gaskets out when you wash the lids and let everything dry fully before you refill it, because damp flour or cereal invites the next problem. Twenty-four pieces is a lot, so measure your shelves first.

See the Vtopmart set on Amazon

As an Amazon Associate we earn from qualifying purchases.

Storeganize large square flour and sugar storage containers, 4 pack

For flour, rice and sugar in bulk

Storeganize Flour and Sugar Containers, 5.3 L, 4 pack

Four large square containers with silicone gaskets and locking hinges on all four sides. They fit a full bag of flour or rice, and come with measuring scoops and labels.

Worth knowing: at 5.3 liters each they are tall and wide, so check your shelf height before you order. They are plastic, which is fine for dry goods.

See the Storeganize containers on Amazon

As an Amazon Associate we earn from qualifying purchases.

Gnats, drain flies and fruit flies

Most people call every tiny kitchen fly a gnat, but there are three different insects, and each breeds somewhere else. Traps catch the adults; the problem only stops when you remove the place they breed. The University of Tennessee's extension guide on small flies is the source for this quick comparison.

Fruit fly

Looks like: About 2 mm, red eyes

Breeds in: Overripe fruit, fermenting drinks, recycling, the garbage disposal

The fix: Remove the source, then a vinegar trap

Drain fly (sink fly)

Looks like: About 2 mm, fuzzy and moth-like, wings folded in a V

Breeds in: The slimy film inside sink drains

The fix: Scrub the film out of the drain

Fungus gnat

Looks like: Dark, up to 1/4 inch

Breeds in: Damp potting soil in houseplants

The fix: Let the soil dry between waterings

Drain flies (sink flies): scrub the drain

Clean kitchen sink with the drain basket out and a stiff drain brush ready to scrub out drain fly breeding film

A stiff drain brush removes the film drain flies breed in. Boiling water alone doesn't.

To confirm the drain is the source, UC IPM suggests coating the inside of a cup with petroleum jelly and turning it upside down over the drain overnight. Flies stuck inside means they are breeding there. The fix is mechanical: scrub the organic film off the inside of the pipe with a stiff brush, clearing any blockage first. UC IPM says boiling water or bleach give short-term control at best because they leave the film behind, and it discourages insecticides for these flies. Enzyme drain cleaners are another option the Tennessee guide mentions. Our guide to natural drain cleaning covers the routine.

Fruit flies: remove the source, then trap

Eat or refrigerate ripe fruit, rinse cans and bottles before they go in the recycling, and don't leave food scraps in the sink or disposal overnight. A small cup of fresh vinegar makes a simple trap. The Tennessee guide adds a useful detail: change the vinegar often, because old vinegar starts to attract other flies.

Fungus gnats: let the houseplants dry

If the small dark flies hover around your plants rather than the sink, the larvae are in damp potting soil. Water less and let the top of the soil dry between waterings. Yellow sticky cards pushed into the pot catch the adults while the soil dries.

Zevo plug-in flying insect trap with refill cartridges

Our pick for fruit flies and gnats

Zevo Flying Insect Trap, 1 plug-in base and 3 refills

A plug-in trap that uses blue and UV light to draw in fruit flies, gnats and other small flying insects, which stick to a hidden cartridge facing the wall. Zevo says there is no spray, no zapping and no smell, and recommends placing it near the source: the fruit bowl, trash or houseplants.

Worth knowing: its customer rating sits a little below the bar we normally set. We include it because no fruit fly trap on Amazon met that bar, and among the widely reviewed traps we checked it scored as well as or better than the rest. It catches adults only, so it won't fix a dirty drain or wet plant soil, it needs an outlet near the problem, and the cartridges are an ongoing cost.

See the Zevo trap on Amazon

As an Amazon Associate we earn from qualifying purchases.

Boromine yellow sticky fungus gnat traps with plant stakes

For fungus gnats in houseplants

Boromine Yellow Sticky Traps, 50 cards and 10 holders

Double-sided yellow sticky cards on stakes that push into the potting soil, where fungus gnats fly up from. Made for plants indoors and outdoors.

Worth knowing: it has fewer ratings and a slightly lower score than we usually require, and the cards are very sticky, so keep them where pets and long hair won't brush them. They catch adults while you fix the watering; they aren't the fix on their own.

See the Boromine traps on Amazon

As an Amazon Associate we earn from qualifying purchases.

How to get rid of cockroaches in kitchen cabinets

In most kitchens the cockroach is the German cockroach: small, tan and fast, and it loves the warm, tight cracks near food and water. Think cabinet hinges, the space under the sink, and the gaps behind the fridge, stove and dishwasher. UC IPM's advice has five steps.

  1. Find them. Put sticky traps in several spots and check them after a few days. UC IPM calls sticky traps the best way to see where roaches are concentrated.
  2. Cut off food and water. Wipe up crumbs and grease, fix dripping taps, keep food in glass jars or resealable containers, and keep trash in a can with a tight lid.
  3. Bait, don't spray. Baits are the main treatment. Sprays give a short knockdown and can push roaches into other rooms, and foggers are often ineffective because they don't reach the cracks where roaches live.
  4. Be patient. A bait program can take seven days or longer to show results.
  5. Seal. Caulk cracks, and add door sweeps and weather stripping to outside doors.
Advion cockroach gel bait tubes with plunger

Our pick for German cockroaches

Advion Cockroach Gel Bait, 4 tubes (pack of 2)

A gel bait from Syngenta (0.6% indoxacarb) that you apply in small dots with a plunger. The listing says it works on German, American and other cockroaches, and that roaches that eat it pass the bait to others. It is a non-repellent, so roaches don't avoid it.

Worth knowing: it is a pesticide gel, so place pea-size dots only in cracks, hinges and gaps, never on counters or anywhere food touches, and store the tubes away from children. At the time we checked, Amazon listed it as shipping in one to two days rather than in stock for same-day dispatch.

See Advion gel bait on Amazon

As an Amazon Associate we earn from qualifying purchases.

Combat child-resistant roach bait stations, 12 count

Enclosed option for homes with kids or pets

Combat Roach Killing Bait Stations, small roaches, 12 count

Closed bait stations with roach-sized openings and a child-resistant case, made for small roaches such as the German cockroach. The listing says each works for up to three months. Slip them under the sink and behind appliances.

Worth knowing: its customer rating sits a little below our usual bar. Stations work more slowly than gel placed right in the cracks, and they are made for small roaches, not the large ones that wander in from outside.

See the Combat stations on Amazon

As an Amazon Associate we earn from qualifying purchases.

If you live in an apartment building, roaches can move between units, so work with your building manager. Our guide on cleaning kitchen cabinets helps with the grease that feeds them.

Mice in the kitchen

Droppings in a drawer, a gnawed cereal box, or scratching behind the cabinets at night all point to mice. The CDC's three-step approach is seal up, trap up and clean up, in that order, because trapping without sealing just makes room for the next mouse.

1. Seal the way in

The CDC says a mouse can get through a hole the width of a pencil, about 1/4 inch. Check inside, under and behind the kitchen cabinets and around the pipes under the sink. Pack small gaps with steel wool and seal around it with caulk. Larger openings need metal, cement, hardware cloth or metal sheeting.

Under-sink cabinet with pipe gaps packed with steel wool and sealed with caulk to keep mice out

Gaps where pipes come through the cabinet wall are a common way in. Steel wool plus caulk closes them.

Xcluder stainless steel wool rodent fill fabric kit

Our pick for sealing gaps

Xcluder Rodent Control Fill Fabric, large DIY kit

Coarse stainless steel wool woven with poly fibers, which the maker says rodents can't chew through and which won't rust like ordinary steel wool. Cut a piece and pack it into the gap.

Worth knowing: it fills the hole but doesn't hold itself in place in bigger gaps, so finish with caulk or sealant as the CDC suggests, and wear gloves while you work.

See the Xcluder kit on Amazon

As an Amazon Associate we earn from qualifying purchases.

2. Trap with snap traps

The CDC recommends traditional snap traps. It advises against glue traps and live traps, because a trapped, frightened mouse urinates, which raises the risk of infection. Poison and bait stations are only for infestations that persist. Set traps against the wall where you have seen droppings, and keep every trap and bait out of reach of children and pets.

Tomcat Press N Set snap mouse traps

Our pick for trapping mice

Tomcat Press 'N Set Mouse Traps, 8 traps

Snap traps you set by pressing down on the top instead of pulling back a bar, which the maker says lowers the risk of pinched fingers. A grab tab lets you throw away the mouse and the trap together without touching either.

Worth knowing: its customer rating sits a little below our usual bar. They are disposable, so each catch uses up a trap, and like any snap trap they must go where children and pets can't reach.

See the Tomcat traps on Amazon

As an Amazon Associate we earn from qualifying purchases.

3. Clean up safely

Don't sweep or vacuum droppings or nesting material, because that can put viruses into the air. The CDC says to wear rubber or plastic gloves, spray the area with 1 part household bleach to 9 parts water (or an EPA-registered disinfectant) until it is very wet, and let it soak for 5 minutes before wiping it up with paper towels. Throw away any food the mice got into.

The trash can: where many kitchen pests start

An open or cracked trash can feeds fruit flies, drain flies, roaches, ants and mice at once, and exposed food waste is where house flies lay the eggs that become maggots. A bug-proof trash can is simply one with a lid that closes fully every time. Empty it when it smells rather than when it is full, bag food scraps, rinse recycling, and wash the can itself with soap and warm water once a week.

simplehuman 50 liter rectangular stainless steel step trash can

Our pick for a kitchen trash can

simplehuman 50 L Rectangular Step Trash Can, brushed stainless

A foot-pedal can whose lid shuts by itself when you step off the pedal, slowly and quietly according to simplehuman, so it doesn't get left half open. The brand rates the pedal for more than 150,000 steps, and the 50 liter size has built-in wheels for cleaning behind it.

Worth knowing: it costs far more than a basic plastic can, and simplehuman sells its own fitted liners, which are an ongoing cost if you prefer them to standard bags.

See the simplehuman can on Amazon

As an Amazon Associate we earn from qualifying purchases.

A 10-minute nightly routine (and a weekly deep clean)

Kitchen counter at night after clean-up, leftovers sealed in containers and nothing left out for pests

Most kitchen pests feed at night. Ten minutes before bed takes their food away.

Roaches and mice are most active at night, so the last ten minutes in the kitchen matter most. Most of the old advice here still holds; it just works best as a routine.

Every night

  • Wash the dishes or load the dishwasher; don't leave dirty plates in the sink.
  • Wipe the counters, stovetop and table, and sweep under the table.
  • Put leftovers in sealed containers in the fridge, and close any open food.
  • Check the fruit bowl and move anything overripe to the fridge.
  • Wipe the sink dry and empty the drain basket.
  • Close the trash lid, or take it out if it has food scraps.
  • Pick up pet food bowls or cover them.

Once a week

  • Wash the trash can.
  • Wipe cabinet shelves and look for droppings, webbing or small holes in packages.
  • Check under the sink for drips and damp spots.
  • Scrub the kitchen drain with a brush.
  • Once a month, pull out the stove and fridge if you can and clean the crumbs underneath.

For cleaners that are gentle to use where you cook, see our guide to non-toxic kitchen cleaning products.

What is safe to use near food, kids and pets

A question we hear a lot: what can you use against kitchen pests that won't end up in your food? These are the rules the university and CDC guidance above agrees on.

  • No sprays on counters, cutting boards, dish racks or inside open cupboards. Baits and traps keep the active ingredient inside a station or a crack instead of on surfaces food touches.
  • Place baits out of reach. Behind appliances, at the back of low cabinets and under the sink, and always as the label directs. The CDC says to keep all traps and bait out of reach of children and pets.
  • No insecticides in the pantry. UC IPM doesn't recommend them for any pantry pest; cleaning, freezing and good containers work.
  • Be careful with essential oils. The ASPCA says concentrated essential oils can be dangerous to pets, and that as few as seven or eight drops of concentrated tea tree oil can cause problems. Don't spray oils where pets eat, sleep or walk.
  • When in doubt, throw it out. Food that pests have been in goes in the trash, not back on the shelf.

Home remedies: what works and what doesn't

Social media is full of natural pest hacks. Some of them help; most of them don't reach the problem. This is what the evidence says about the ones shared most.

Soapy water on ant trails

Works

It removes the scent trail other ants follow (UC IPM). Pair it with bait.

Vinegar

Works as a trap

Fresh vinegar is a good fruit fly bait. It isn't a repellent, and it won't deal with ants, roaches or moths.

Freezing flour and grains

Works

A week in the freezer kills eggs and larvae (NPIC).

Peppermint or tea tree oil

Won't end an infestation

Mint oil has shown some repellent effect on roaches in lab tests, but a smell doesn't reach the nest and fades fast. Concentrated oils can be dangerous to pets (ASPCA).

Bay leaves in the pantry

Harmless, not a fix

A 1981 lab report found a repellent effect on cockroaches, but none of the university pest guides we checked list bay leaves as a way to control pests.

Baking soda in the drain

Doesn't work

Drain flies breed in the film inside the pipe. Only scrubbing removes it (UC IPM).

When to call a professional

  • Roaches are still showing up after two or three weeks of baiting, or you live in a building where they move between apartments.
  • Ants keep coming after weeks of baiting, which can mean a very large colony.
  • Mice keep returning after you have sealed and trapped, or you find droppings in several rooms or signs of rats.
  • You can't tell what the pest is, or it is damaging wood or wiring.

Kitchen pest control FAQ

Does keeping a clean kitchen prevent bugs?

It removes most of what pests come for, which is the biggest single step. But a spotless kitchen can still have pantry moths that arrived in a bag of flour, drain flies in the pipe, or ants coming through a crack. Cleaning works best together with sealed food containers and closed entry points.

What are the little black bugs in my kitchen?

It depends on where they are. Tiny black ants on the counter or near the sink, small dark beetles in flour or cereal, fuzzy little flies around the drain, or dark gnats near houseplants. Match what you see to the quick guide at the top of this article.

Why do I see bugs in the kitchen at night?

Cockroaches and mice feed mostly at night, when the kitchen is quiet and dark. Crumbs, dishes in the sink and open food left out overnight are what they find. The nightly routine above takes that away.

Can I use vinegar for kitchen pests?

Vinegar is useful for wiping surfaces and makes a good fruit fly trap. It doesn't repel or kill ants, roaches or pantry moths. For ant trails, plain soapy water does the job.

Does peppermint oil repel cockroaches?

Mint oil has shown some repellent effect on cockroaches in lab tests, but it doesn't reach the nest, the smell fades, and concentrated oils can be dangerous to pets. Gel bait placed in cracks is what university pest programs recommend.

What pest control won't contaminate my food?

Baits in closed stations or placed inside cracks, traps, and physical fixes like hard food containers, freezing and sealing gaps. Avoid sprays on counters and inside cupboards, and never use insecticides in the pantry.

Can mice get on kitchen counters?

Yes. Mice are good climbers and can reach counters from cabinets, pipes and appliance cords. If you find droppings on a counter, clean it the CDC way described in the mice section, with gloves and a bleach solution, never by sweeping.

How do pantry bugs get into the house?

Usually inside a package of flour, grain, cereal, dried fruit or pet food from the store. From there they spread to other open food, which is why hard containers with tight lids matter.

Sources

  • UC Statewide IPM Program (University of California): Ants; Cockroaches; Pantry Pests (Pest Notes 7452); Moth or Drain Flies.
  • University of Tennessee Extension, W 1256, Small Fly Management in Homes and Other Structures (2024).
  • National Pesticide Information Center (Oregon State University), Pantry Moths.
  • Centers for Disease Control and Prevention: How to Seal Up, Trap Up and Clean Up to control rodents.
  • ASPCA, The Essentials of Essential Oils Around Pets.
  • Appel et al., "Repellency and toxicity of mint oil to American and German cockroaches," Journal of Agricultural and Urban Entomology.
  • Verma, "A natural cockroach repellent in bay leaves" (1981); Karr and Coats, repellency of dried bay leaves to the German cockroach, Arthropod Management Tests (1989).
  • Manufacturer listings on Amazon for the TERRO, Dr. Killigan's, Vtopmart, Storeganize, Advion, Combat, Zevo, Boromine, Xcluder, Tomcat and simplehuman products (checked September 28, 2026).

We read the filings so you don't have to

We'll email you when something changes: a cookware recall, a brand quietly rewriting its safety page, a filing that contradicts what's on the label. Not on a schedule — only when there's something worth your attention.