Digging is a perfectly normal doggie trait. It's an adaptive behaviour that's seen in the wild and ingrained into their instinct. When dogs dig they are simply carrying out one of their natural, predisposed functions. Digging around fences and gates, however, can cause problems. This is not only harmful to the foundations, but could be a sign that your dog wants to escape.
Place Rocks Around the Fence
Place rocks at the base of your fence in areas where your dog likes to dig. When they realise that they can no longer access the soil, they'll hopefully stop trying. If your dog manages to break the barrier and move the rocks, fill in the holes with a mixture of gravel and soil to make it harder to unearth.
Place Timber Under the Gate
The gate is usually the most problematic area. While fences make contact with the ground, gates have some leeway above the ground, making it an easy target. Dig a trench under the gate and bury a piece of landscape timber between the posts. Use galvanized deck screws to attach the timber to the gate posts. This will prevent your dog from digging it out. Fill in the trench with dirt around the timber.
Lay Down Sheets of Chicken Wire
Dogs hate the feel of chicken wire under their paws. Laying down sheets of chicken wire by the edges of your fence may deter dogs from digging. If taking this approach, make sure the edges are tucked underground as they can be quite sharp. Alternatively, dig a small, narrow trench at the base of your fence and bury the chicken wire underground to form another barrier. Again, make sure the edges are facing outwards.
Train and Entertain Your Dog
Boredom is one of the most common reasons why dogs try to dig their way out of gardens. Try not to leave your dog alone for extended periods of time and make sure it has plenty of stimulation, such as a playmate or toys. Regular walks, playing fetch and rotating the toy box should keep things interesting. Some breeds, such as terriers, were bred to dig and hunt. Rather than training them not to dig, which isn't good for their health and well-being, train them to dig in other areas of the garden. Try burying some dog treats in a suitable spot. When your dog starts digging, give it plenty of praise.