The song was written by producer Bob Thiele (as "George Douglas") and composer and performer George David Weiss.
One source claims the song was first offered to Tony Bennett, who turned it down, although Louis Armstrong biographer Ricky Riccardi disputes this claim. George Weiss recounts in the book Off the Record: Songwriters on Songwriting by Graham Nash that he wrote the song specifically for Louis Armstrong. Weiss was inspired by Armstrong's ability to bring people of different races together.
Because he was gigging at the Tropicana Hotel, Armstrong recorded the song in Las Vegas at Bill Porter’s United Recording studio. The session was scheduled to follow Armstrong's midnight show, and by 2 am the musicians were settled and tape was rolling. Arranger Artie Butler was there with songwriters Weiss and Theile, and Armstrong was in the studio singing with the orchestra. Armstrong had recently signed to ABC Records, and ABC president Larry Newton showed up to photograph Armstrong. Newton wanted a swingy pop song like "Hello, Dolly!", a big hit for Armstrong when he was with Kapp Records, so when Newton heard the slow pace of "What a Wonderful World", he tried to stop the session. Newton was locked out of the studio for his disruption, but a second problem arose: nearby freight train whistles interrupted the session twice, forcing the recording to start over. Armstrong shook his head and laughed off the distractions, keeping his composure. The session ended around 6 am, going longer than expected. To make sure the orchestra members were paid extra for their overtime, Armstrong accepted only $250 musicians union scale for his work.
The song was not initially a hit in the United States, where it sold fewer than 1,000 copies because Newton did not like or promote it, but was a major success in the United Kingdom, reaching number one on the UK Singles Chart. In the United States, the song hit No. 16 on the Billboard Bubbling Under Chart. It was also the biggest-selling single of 1968 in the UK where it was among the last pop singles issued by HMV Records before becoming an exclusive classical music label. The song made Armstrong the oldest male to top the UK Singles Chart. Armstrong's record was broken in 2009 when a remake of "Islands in the Stream" recorded for Comic Relief—which included the 68-year-old Tom Jones—reached number one in that chart. Tony Bennett did go on to record "What A Wonderful World" several times, as in 2003 with k.d. lang, paying homage to Bennett's friend, Armstrong.