This was The Beatles' second UK session to take place outside EMI Studios, following their February 9, 1967 visit to Regent Sound Studio. It took place at Olympic Sound Studios, an independent studio situated at 117 Church Road, Barnes, London.
The Beatles were working on Baby You're A Rich Man, intended for the Yellow Submarine soundtrack, but which was eventually used as the b-side to All You Need Is Love. It was The Beatles' first song to be recorded and mixed entirely away from Abbey Road.
I'm a terrible pusher on sessions. I do a lot of orchestral work and you naturally push people along. The Beatles said that this was the fastest record they'd ever made. They were used to a much more leisurely pace. We started the session at about 9pm and it was finished and mixed by about 3am, vocals and everything. They kept playing, version after version, then we spooled back to the one they liked and overdubbed the vocals
Source: The Complete Beatles Recording Sessions, Mark Lewisohn
One tape reel was filled with rehearsal takes, before 12 takes were recorded. The last of these was the best attempt, and featured piano, drums, maracas and tambourine. Paul McCartney then overdubbed a bass guitar part and John Lennon sang lead vocals, with harmonies by McCartney and others in the chorus.
Two reduction mixes were then made to free up space on the tape. The second, known as take two, had George Harrison's lead guitar and Lennon's Clavioline introduction overdubbed onto track three. Track four was filled with more vocals, some backwards piano in the final verse, and a single note of vibraphone played by tape operator Eddie Kramer.
A mono mix was then made. It took just one attempt, and became the version released on the All You Need Is Love single.