City officials want the hundreds of thousands of people who usually flock to an annual Halloween street party here to stay home or go elsewhere after several episodes of violence in recent years.

Officials have advised would-be revelers through fliers, public service announcements and juvenile probation officers that they won't find many treats in the Castro District, home in past years to the largest Halloween happening in the San Francisco Bay area.

What they will find are hundreds of extra police officers, shuttered restaurants, stepped up sobriety checks and no bus or train service after 8:30 p.m.

"This is really a public safety decision," said Supervisor Bevan Dufty, who represents the Castro and spent the better part of a year trying to arrange an alternative city-sanctioned gathering. "I'm disappointed my message is one of, 'Please don't come."'

The festivities started decades ago as a homegrown celebration for San Francisco's gay and lesbian community, but has drawn a scarier element in recent years. In 2002, five people were stabbed. Three years ago, someone wandered the crowds wielding a chain saw.

Last year, nine revelers were shot when a confrontation between two groups of young people erupted into gunfire, despite ramped-up security. No one has been arrested in the shooting.

"It's absolutely eerie when you are looking around seeing people, most of them not in costume, looking each other in the eye with suspicion," said Castro resident Betty Sullivan, who narrowly missed getting caught in last year's gunfire.

Sullivan said she is anxious enough about what will transpire this year that she doesn't even plan to watch from her front stoop. On Tuesday, she could hear loudspeakers and sirens, part of the city's emergency notification system, being tested from her home.

"Everybody I've talked to is pretty much on the same page I am, which is it needed not to happen," she said. "I'm like, shut it down. I don't even want to pretend it's going to be OK."

People should come to the Castro only if interacting with police is their idea of a good time, said Nathan Ballard, a spokesman for Mayor Gavin Newsom. A city-financed Web site lists dozens of other events elsewhere.

"The residents of the Castro are fed up with having a large, regional party in the Castro, and frankly anyone who thinks it's a good idea to have a large, regional event in the Castro on a weeknight needs to have their head examined," he said.

To reinforce that the welcome mat has been officially rolled up, the city arranged to have probation officers throughout the area tell their young clients that going into San Francisco will be considered a probation violation.

Some business owners were angry when the city asked them to close early on Halloween night, but 34 bars, restaurants and stores that sell liquor have since agreed, according to Dufty. He said he hopes to help organize a pub crawl or another event to make up for the money they lose.

"There will be people who come to see what's happening, but when they realize the restaurants and bars are almost universally closed, I think they will go home," he said.