On one Criminal Minds show, one of the characters said that stranger danger did more damage than good BECAUSE most children are not abducted by strangers. They are mostly abducted by family and then by acquaintances. Only .43 out of 1000 are abducted by strangers. The statistics are different for teenagers, though.
Children need to be taught a code word and they need to practice it everyday while they are younger. "If mommy wants you to come out to the car with someone, I will always use the code word."
Honestly, I very much doubt the usefulness of this. Is there any documented case where it has worked? Where a child reported that someone tried to get them to go somewhere, and the child didn't go because the person couldn't give the code word?
The trouble is that children young/immature enough that they can't accurately evaluate an unexpected request to go somewhere with the adult, are also unlikely to remember the code word plan in a real life situation, or are likely to be easily confused into telling the person what the code word is or believing it when the person tells them mommy must have forgotten to tell them the code word because she was upset about the "emergency".
Many years ago, I had my own first-hand experience with the ability of young children to understand and apply lessons about how to deal with potentially dangerous situations. Early one weekend morning, I was walking down my block to go to a nearby convenience store, and saw a very small boy (later confirmed age 5) walking along the sidewalk by himself. I thought it was a little odd, and I didn't recognize him, but wasn't quite worried enough to scare him by approaching and questioning him. A few minutes later, on my way back, I saw him again, walking along the same sidewalk in the opposite direction. That was plenty worrisome enough to stop and ask him if he was lost.
He told me his parents had dropped him off in front of his grandmother's house, as they were rushing his little brother to the emergency room (about 3 blocks away) because he was having an asthma attack. His grandmother was expecting him, but didn't answer the door when he knocked. So I walked him over to his grandmother's house, tried knocking on both the front and back doors, and got no response. Sooooo, I suggested to the little boy that he come with me to my house a little ways down the block, while I called the hospital emergency room to reach his parents. He thought that was a good idea, and seemed relieved to have an adult taking over the situation even it was one he didn't know. So he walked home with me and came in the kitchen door with me, and I got out the phone book, looked up the number and picked up the phone to start dialing. THEN he said, in a tiny scared little boy voice that I'll never forget: "I think I better go outside because I'm not allowed to go in stranger's houses." I told him that was a very good rule, and to go wait on the porch -- but thinking to myself that it obviously would have been way, way too late for this rule to do any good, if I'd actually been the dangerous kind of stranger.
Happy ending: I quickly got his father on the phone at the emergency room, father called the grandmother (who was apparently quite hard of hearing, and just hadn't heard all the knocks at her doors, even though she was expecting the boy), called me back to ask me to walk the boy back over to his grandmother's house, and she was waiting at the door, very apologetic.
So yes, the little fellow remembered what he'd been taught. But not in a way that would done a bit of good if an actual need for it had arisen.