The pilot for this series was the first professional acting job for Bob Denver, who had been a grade school teacher and postal worker before joining the cast. Denver's sister was a casting agent's secretary, and had his name added to the audition candidates for the role of Maynard G. Krebs.
Bob Denver was drafted during the production of the series' fourth produced episode, "The Big Sandwich". Maynard was therefore written out of the series with the episode "Maynard's Farewell to the Troops", and Michael J. Pollard was cast as Maynard's cousin Jerome Krebs, who would assume Maynard's role in future episodes. However, Denver failed his Army physical and was rejected "4F" by the draft board. After shooting two episodes with Pollard, this was decided to rehire Denver and write Maynard back into the series. Pollard had signed a "play or pay" contract, and was paid for all 30 episodes he had been signed for upon his dismissal.
Dobie's father Herbert T. Gillis had a catchphrase during Season One whenever he found himself stymied or frustrated by Dobie: "I gotta kill that boy, I just gotta!". The sponsors disapproved of the running gag, and required the producers to both discontinue its use and soften somewhat the hard edges of Herbert T. Gillis.
A pilot for a "Zelda" spin-off starring Sheila James was produced in 1962, but was scrapped after James T. Aubrey, then head of CBS, rejected this. James was told by producer/director Rod Amateau that Aubrey found Zelda "too butch", a critique that deeply worried James, then a closeted lesbian. James, under her real name of Sheila Kuehl, went into law and politics after acting parts dried up, eventually becoming the first openly gay person elected to the California State Assembly and a California State Senator.
To differentiate Dobie Gillis from Chuck McDonald, the character that Dwayne Hickman played on The Bob Cummings Show (1955), Max Shulman and Fox required Hickman to dye his dark brown hair blond. Their concern was that the sponsors would feel audiences would confuse Dobie with Chuck, a character on a different series with different sponsors. Continually bleaching his hair caused Hickman to suffer hair loss and blisters on his scalp, and after appealing to the producers, he was allowed to stop bleaching his hair after the first season.