Thanks to the rat's contribution to the bubonic plague, we think of rats as being disease-filled vermin. According to Washington State University, rats are the perfect pest because they are adaptable enough to live in both urban and rural areas, will eat anything and can reproduce year-round. But in the garden, rats are more than just a pest. Since rats will eat anything, they will not only eat your fruits and vegetables, they will even strip the bark from ornamental trees and shrubs. Rats will also contaminate your garden soil with urine and excrement. You can get rid of rats in your garden by making it a hostile environment for them.
Manage your compost piles so that any potential rat food, such as kitchen scraps, is placed in the center of the pile and for quick decomposition. This will discourage rats from hanging around. Elevate compost piles on pallets 12 inches above ground so rats won't take shelter in them.
Remove all fallen debris that rats might see as potential food. This includes vegetable scraps, seed pods and unused or spoiled fruits and nuts.
Store garden and lawn seed, bone meal or lawn products that rats would eat in rodent-proof containers such as plastic storage tubs with tight-fitting lids.
Eliminate any potential rodent shelter by sealing up cracks in any garden sheds. Repair windows and doors, caulk up cracks, repair holes in the foundations and seal any holes where pipes or wires enter the garden sheds.
Cut back blackberry and raspberry bushes and remove all brush from your garden to eliminate shelter for rats.
Put out snap traps to kill rats. Live traps and poisons are not advised because rats can carry diseases and poisons that can contaminate your garden. Leave snap traps baited and unset for a time so that the rodents can become used to feeding on them. Then set them to kill rodents. Discard rats and snap traps when the traps kill the rodents.