Rabbits and groundhogs are natural diggers but they think that the purpose of digging is to create a living space. They are not born knowing that they can get under a fence by digging. For that they have to be trained.
Here’s
how you do it. Put a chicken wire fence around your beans. The chicken
wire should be a 1" (2.5 cm.) mesh because teenage rabbits
and groundhogs can zip right through 2" mesh and you want to train
them to go under the fence, not through it. Leave spaces here and there along
the bottom of the fence that are no more than 1" – just enough to
give them the idea they might get under without quite leaving them room to
do so. Now neither the rabbit nor the groundhog is very smart but here’s
where their digging instinct works to your advantage – sooner or later a
paw will snake under that fence and enlarge the space. Once they get the
idea they will start digging anytime they come to a fence (and having the
bottom strand buried an inch or two won’t stop them).
If your wildstock is untrained then having the bottom strand of the fence
covered with an inch of soil is sufficient to keep them out of your beans
(or lettuce or peas ...). Once they have been trained by you or by a neighbour,
you will have to bury the bottom strand more than 6". If the fence
is temporary – to be removed when the crop matures – you may prefer to
leave the bottom strand of the chicken wire close to the surface and add
a second fence, this one electric.
An electric fence by itself is ineffective with rabbits (and groundhogs) because they are too dumb to figure out where the shock is coming from – they just assume that a random shock is one of the more unpleasant parts of being a rabbit.
Electric fences are most effective for the raccoon, the smartest animal in North America. When the lead animal in a pack of raccoons goes through an electric fence, he knows immediately where the shock came from and complains bitterly to the rest of the pack. Sweet corn is their favourite food but it is very seldom that more than one raccoon in a pack goes through an electric fence. And, once he gets back out, he doesn’t doesn't go through the fence again without checking it first.
Electric fences for small animals should have two strands, 6" and 12" high – the right height so that a wire will brush their back if they go under or their belly if they go over. To use electric fencing in conjunction with chicken wire, place the electric fence 6" outside the chicken wire fence. The bottom strand of chicken wire should be covered with at least 2" of soil so the animal has 30 seconds of digging before moving forward. While he is digging his back will be up against the electric wire and the shocks will be very distracting for him.
If you are concerned about the mental health of your wildstock, you may not wish to use this method of keeping them out of your beans. They may connect the shocks with digging and develop a phobia about this necessary part of their survival.