Instructions
Avoid yelling when your dog barks at people. To your dog, this gives him more of a reason to bark.
Say "Speak" and introduce your dog to a person to provoke barking at the same time. You cannot teach your dog to stop barking until you teach the "Speak" command. After two barks, place a treat near your dog's nose. Once the barking stops, give the treat and praise your dog.
Continue telling your dog to speak, introducing a person and then giving a treat when your dog stops barking. Eventually, your dog will bark whenever you say "speak."
Give the "speak" command. When your dog barks, say "quiet" and offer a treat just as you did before. Give the treat and praise when your dog is quiet.
Keep practicing the "quiet" command until your dog stops barking whenever you use it.
Practice using the "quiet" command around people and situations when you dog would normally bark. While training, always give a treat and praise. Eventually, your dog will stop barking when you say "quiet" even when you don't offer anything.
How to Fix a Dog From Barking When Meeting People
A dog that barks at new people is not necessarily aggressive. Barking is a natural behavior in dogs, and dogs should never be punished for this behavior. However, if your dog always barks excessively when meeting new people or when people come to your home, it's probably not an issue that should be ignored. If your dog ever shows signs of aggression, you need to consult with an animal behaviorist and keep your dog away from people until the problem can be addressed.