It is sometimes possible to stop dogs from excreting in a garden by changing the fertilizer, setting the sprinklers to go off when the dogs usually visit or installing a motion-activated sprinkler system. If a garden is fenced, maintaining the fence and keeping gates closed also help to keep dogs away from the yard.
Gardening Tips 'n Ideas suggests that the smell of fertilizer used in a garden may attract or repel dogs. If a dog is attracted to the smell of the organic fertilizer being used, switching to a chemical fertilizer with a different scent may repel the dog, or vice versa.
Water is a good way to keep dogs from excreting in the garden. If sprinklers are already going off when a dog arrives, he is less likely to stop and foul the lawn. Some dogs even shy away from lawns that are already wet. For a persistent problem with messy canines, installing a motion-activated sprinkler may do the trick. These sprinklers only go on when someone walks in front of their sensors, triggering them. A dog who has a sprinkler turn on seemingly out of nowhere is likely to become frightened and not want to visit the lawn again.
Some people suggest alternate but unproven ideas for keeping dogs away from a garden, such as leaving fake dog poop or filled bottles of water on the lawn.