The episode was written by Al Jean and Mike Reiss, and directed by Rich Moore. Michael Jackson guest-starred as Leon Kompowsky, but went uncredited for contractual reasons; his role was not confirmed until later. Jackson was a fan of the show and called creator Matt Groening offering to do a guest spot. Jackson pitched several story ideas and wrote the song "Happy Birthday Lisa" for the episode. The character's singing voice was performed by a soundalike, Kipp Lennon, due to contractual obligations Jackson had with his record company. The episode references Jackson's career, with Kompowsky singing portions of the songs "Billie Jean" and "Ben".