I agree with Mamazita, Union Square is where you want to be. In addition to her hotel recommendations, I'd add The Handlery because it's one of the few hotels in San Francisco with an outdoor pool. It's heated, and in a central courtyard, so it's a lot of fun for kids. The hotel itself is a block off of Union Square, so it's close to everything.
If you're doing Airbnb or the like, then try Russian Hill or Nob Hill. Both are close to Union Square, and accessible by trolley (fun!) as well as bus. Do not stay in the Tenderloin. When I was young and poor, I lived there and... yeah. Don't stay in the Tenderloin. Or near Civic Center. Sketchy. Pacific Heights is a good neighborhood, but isn't as close as Russian/Nob hills to all of the things you'll want to see. South of Market is probably mostly okay, too, if you had to.
Staying near Golden Gate Park could also be fun for your kids. That would put you near the DeYoung Museum, Academy of Sciences (not to be missed; it's my kids' favorite place), Conservatory of Flowers (also fun - they have a big exhibit on carnivorous plants, which kids love), and so on. The only caveat to staying out near the park is that it's a long haul on Muni to get there. With a car it's not bad.
As far as neighborhoods to avoid... Hunter's Point. Don't stay there under any circumstances. Ocean Beach/Outer Sunset probably wouldn't be good (only because it's pretty far out there if you're using public transit, although I used to live there and loved it). Depending upon how adventurous you feel, you may want to avoid the Castro (it's, um, pretty wild sometimes, and could possibly be a little shocking!).