Digging and scratching surfaces is a natural inclination for dogs -- especially for digging breeds like terriers. Digging at carpet can become destructive, however, and can even snag and hurt your dog's nails. Redirect his behavior, make sure he's sufficiently entertained and if the behavior persists, see a vet for a consultation.
Your dog may be scratching at the carpet because he's anxious when you're gone, a type of doggy separation anxiety. Spend adequate time with your pup and exercise him to get out pent-up energy. Give him special toys when you leave, such as interactive balls that dribble kibble, to keep him entertained. If you're away for extended periods of time, hire a pet sitter or ask a neighbor to check on him during your absence.
Dogs often dig, scratch and circle before they lie down as a way to get comfortable. Protect your carpet by providing your dog with a comfy bed, preferably one with raised edges so he can feel like he's snuggling into a safe den. A pile of blankets on top of carpet also can help reduce the scratching problem and give your pup a more acceptable fabric to work with.
Climate Control and Territory Protection
Outdoors and in the wild, dogs scratch and dig the soil to get cool, stay warm or hide from the elements. If your pup is scratching the carpet in a particular spot, such as where he sleeps, it could be too cold or too warm for his comfort. Check for drafts or open vents. Dogs also are territorial by nature, so if another pet regularly occupies a particular patch of carpet, your dog could be overinterested in it because of its smell.
Some dogs have obsessive-compulsive disorders in which they repeat the same action. The behavior usually presents with glazed-over eyes and a serious intent on the project at hand. Stop the behavior by redirecting attention. If that doesn't work, see your vet and ask for a recommendation to a pet behavior specialist.
Stop your dog from scratching at the carpet the first time he starts. If he gets a regular dig zone going, it will smell like him and entertain him, making the problem worse. Spray the area with a deterrent spray or remove him from the area when he starts, issuing a command like, "no scratch!" If it's possible to remove the carpet for awhile, it could help break the habit.
When to See a Vet
Dogs with severe separation anxiety may be prescribed an anti-anxiety medicine. Scratching paired with paw licking also could be a sign of a foot or skin irritation. Dogs who just can't seem to get comfortable and are constantly digging at surfaces before lying down may be arthritic; pay attention to how hard it is for your pup to rise from a down position. If you can't get to the root of the problem, or your dog becomes aggressive when you try to stop his carpet scratching, it's time to see a vet.