It can sometimes be boredom, but I think too, that some dogs just plain like to dig. It's fun. It probably comes from some instinct used for looking for something...buried treasure. I mean, dogs need to dig sometimes. Their sense of smell is so keen that maybe there's something there they're trying to find. Who knows?
What some people do is make a big sand box or dirt box and bury some cool toys and even some treats. You can use 2x8's or 2x6's. Get them started....join in the fun, and make a fuss when they start digging....and give more treats...In other words, reward for digging in the designated box.
You have to be there to show them though. When they dig in the other places, you'll have to distract and show them the sand box.
Some people have put poo in the places they normally dig and say that makes it less attractive. Hmmmm. I don't know. Some dogs find the grossest things attractive. But you could try that.
For the first days while you're trying to show them about this new sand box, you could maybe turn on the sprinklers over where the places are that they dig where you don't want them to. Or lay down some plywood over the area. They may still find a new area though, so supervision and training will have to take place at first before you leave....maybe an intense, weekend seminar for the dogs: How to Dig in the Degisnated Location. LOL. Hopefully, they'll like their new, big sand box.