The new policy takes effect Monday. Lucile Packard spokesman Robert Dicks said the hospitals have been notifying patients' families and those with upcoming appointments at the hospital.
The announcement is so recent that the hospitals have not yet received feedback from affected families, he said.
Dicks said he does not know of another instance in which the hospitals took this type of action. "It's an unprecedented situation," he said.
Health officials are extremely concerned with stemming the spread of the H1N1 virus this flu season. Pregnant women and young children are particularly susceptible to virus.
Dicks said a range of Stanford medical personnel, from neonatal intensive care unit staff to infectious disease specialists, agreed the policy is necessary "to best protect expectant moms, new moms and all the patients inside the hospital."
The hospitals will re-examine the policy sometime in spring, after the flu season has passed. For patients with particularly severe conditions, the hospital can work with families to grant temporary visiting permission when appropriate, Dicks said.
While the Stanford hospitals may be the first in the Bay Area to enact such a policy, a wave of hospitals across the nation have temporarily banned younger visitors as the height of flu season approaches.