Your dog rests while a visitor sits on the sofa. The visitor gets up, and the dog barks or moves toward them. Sitting and moving are different scenes to a dog. The change in height, direction, and speed can be surprising, especially in a small room.

For now, put your dog in a comfortable separate room or behind a secure barrier before a visitor stands or leaves. Tell guests the routine so they do not try to reassure, pet, or step around a barking dog. If your dog has snapped, reached someone, or blocked an exit, do not set up more practice without a qualified, reward-based behavior professional. A veterinary check is sensible for a new change.

Work with movement at a distance

Teach your dog to settle in their own place when the house is quiet. With a willing adult helper and a secure setup, have the helper make one small movement while you reward your dog for staying comfortable. End before barking. Across sessions, the helper may shift position, stand slowly, then take a step. Change only one piece at a time. If your dog tenses or cannot take a treat, increase distance and reduce movement.

Real guests should still be able to leave without participating. Keep the dog safely apart until the door closes. You are not trying to make your dog enjoy sudden movement beside them. You are building a predictable route through a visit, with no one forced to test a warning. For more on arrivals and movement around guests, see the visitor and doorway guide, keep a safe separation plan when the dog is worried

Sources: Dogs Trust: Dog aggression towards visitors. Dogs Trust: How to prepare your dog for visitors.