Hanging on the wall of Barney's apartment set is a framed poster of the cover art for the 2001 novel 'Carter Beats the Devil' by Glen David Gold. The novel is about a magician in 1920s San Francisco; Neil Patrick Harris, who plays Barney, is a talented magician.
When Neil Patrick Harris directed a 2010 limited-run production of the musical "Rent" at the Hollywood Bowl, he cast Wayne Brady in the role of Tom Collins, after Brady and Harris had previously played brothers on "How I Met Your Mother".
Alyson Hannigan's character on Buffy the Vampire Slayer, Willow Rosenberg, once mentioned that she wrote Doogie Howser, M.D. fan-fiction as a girl. Hannigan went on to star in "How I Met Your Mother" with Neil Patrick Harris, who as a boy played Doogie Howser. Alyson Hannigan' who plays Lily, is perhaps best known prior to starring in 'How I Met Your Mother' for her role on "Buffy the Vampire Slayer". The creators of both of these shows - Joss Whedon of the Buffy series and Carter Bays and Craig Thomas of HIMYM - all graduated from Wesleyan University, as well as did the characters Lily, Ted, and Marshall on HIMYM. Additionally, Hannigan's character from the Buffy series, Willow, got early acceptance to Wesleyan, along with many other schools. Several cast members have also worked with Joss Whedon, notably stars Alyson Hannigan' (Buffy the Vampire Slayer), Neil Patrick Harris (Dr. Horrible's Sing-Along Blog) and Cobie Smulders (The Avengers). Also appearing have been guest stars Morena Baccarin (Firefly/Serenity), Alexis Denisof (Buffy the Vampire Slayer/Angel/Dollhouse), Amy Acker (Angel/Dollhouse), Tom Lenk (Buffy the Vampire Slayer/Angel), Harry Groener (Buffy the Vampire Slayer), Danny Strong (Buffy the Vampire Slayer). The search for all the main characters' so-called "doppelgangers" is a running joke throughout this series. In 'Buffy the Vampire Slayer' doppelgangers were also a frequent theme of many episodes, and most of the major characters (including Buffy, Xander, and Willow) encountered doubles of themselves through plot contrivances of magic or alternate universes.
When both Samm Levine and Neil Patrick Harris were on Kevin Pollak's Chat Show, Levine said that he was called to audition "more than once" for the role of Barney Stinson, even though he himself thought that he was wrong for the role. Levine told Harris that he thought Harris was better as Barney than he would have been.
One of the show's recurring gags is, whenever somebody says a phrase or word that resembles a military rank (eg. "Major buzz-kill") both Ted and Robin (and in some instances Barney, Marshall and Lily join in) salute and repeat whatever is said as though addressing a military officer ("Major Buzzkill").
Alyson Hannigan was pregnant while filming many season four episodes, but the show-runners were not interested in her character, Lily, also being shown as pregnant. Most episodes used time-honored TV tricks to hide Hannigan's pregnancy, including baggy tops and giant handbags, but the episode "The Possimpible" showed Hannigan's pregnancy bump in the context of a subplot in which Lily wins a hot dog-eating contest and has a comically distended stomach afterward. A similar visual gag was used in the sitcom Titus several years earlier. Actress Cynthia Watros was pregnant during the show's second season, although her character "Erin" was not meant to be pregnant. So, in addition to the "time-honored TV tricks" being used to hide Watros' pregnancy, a flashback scenario was used in one episode that showed her character Erin winning a pie-eating contest and her actual pregnant belly was shown afterwards. After Hannigan told the show-runners that she was pregnant, Cobie Smulders discovered that she was also pregnant. Neither of the characters they play were pregnant on the show, so the costumers had the job of simultaneously hiding the pregnancies of the series' two main female actors.
Although singers Britney Spears and Katy Perry were two of the biggest guest stars, fashion designer Tim Gunn was the most welcomed guest star from the cast and crew. Nearly everyone on set wanted an autograph from him.
One ongoing joke is that a favorite topic is "Who is Ted's 'best friend'". Even though it is already confirmed that it is Marshall, Barney ignores this every time and claims that he is Ted's best friend.
Because of the numerous scenes and the quick-cut nature of the show's visual style, the show is filmed without the traditional live studio audience. The finished episode is later shown to an audience, and their reactions are recorded and added for broadcast. The series' creators joke that the long set-up time between scenes would cross the line from "studio audience" to "hostage situation."
All of Lyndsy Fonseca and David Henrie's scenes as Ted's future children were filmed during the first season to keep them the same age throughout the series. This includes a scene for the show's eventual final episode that includes the titular Mother which were filmed early in the second season.
Ted and his friends regularly got to Maclaren's Pub, which is a bar right next to Ted's apartment. The pub was named after 'Carl Maclaren', who is the associate producer, assistant to Carter Bays. Also, a bartender named Carl plays a minor role in the show.
In the DVD commentary for the Pilot episode, Josh Radnor reveals that he is allergic to dogs, something the creators didn't know until Radnor was cast. That may have played a part in the decision to get rid of Robin's dogs in Season 2, when she and Radnor's characters are dating.
Most of the websites featured in the show such as www.canadiansexacts.org and www.stinsonbreastreduction.com are real websites. www.lilyandmarshallselltheirstuff.com was created for charity and items from the show were auctioned off.
If one were to discount Robin (Cobie Smulders), since she is a main character, then the ex-girlfriend of Ted's (Josh Radnor) who has appeared in the most episodes would be Victoria (Ashley Williams), with 15 overall.