When we first got Tootsie, our Blue heeler mix, we lived out in the country, so there was not usually any other people nearby, and she was a pretty quiet dog.
Then, last fall, my husband almost died, and we had to leave everything and move to town where we could get him to the VA hospital for treatment.
Now, we live on a sidestreet, but there is a whole lot of foot traffic, and people walking up and down all day and night.
Tootsie thought she was supposed to bark at everyone who came by. Scolding her would stop her, but only until the next person walked past the house.
I found a device on Amazon called the "Dog Repeller", and it emit an ultrasonic noise when you push the button.
The first time I tried it, Tootsie stopped barking and ran into the shed. After a few days of this re-inforcement; she stopped barking at people unless someone actually comes into the yard. It only costs a few dollars , and it is well worth it ! the dog doesn't get hurt like with a shock collar, and they learn really fast not to bark.