The original premise of the movie was a Mexican-American child discovering his heritage during a trip to Mexico after the recent death of his mother. As the movie developed, everyone realized that the story was turning into the opposite of what Día de los Muertos is about note Miguel was supposed to learn to let go of his mother and move on with his life, while Día de los Muertos is a celebration that keeps deceased loved ones' souls alive through memory, leading to them rewriting the premise. Its also one of the reasons why Miguel became a Mexican child.
None of the people involved early in the movie were Mexican or Hispanic and were approaching the subject from a culturally removed perspective. This changed after backlash mounted from Disney trying to trademark "Día de los Muertos" in anticipation of the film, and several Mexicans and Mexican-Americans were hired as writers and consultants (including the very critics who started the backlash). Adrian Molina even went from storyboarder to co-writer and co-director.
Though the movie is technically Pixars first musical still, it was going to be a full-on, break-into-song musical before it got demoted to a Music Story. The scenes from the original version, including a musical number that opened the film and explained the Día de Muertos, can be found on Blu-ray, Digital and 4K Ultra HD releases. This partly came about upon the filmmakers realizing the contradictory nature of giving Abuelita Elena a musical number about why the family doesn't allow music.
Miguel was originally named Marco, but the filmmakers changed the name when they discovered Star vs. the Forces of Evil contained another animated Latino Disney character by the same name who also happens to have a mole on his face, wears a red hoodie and travels to an alternate fantasy world.
Elena's Weapon of Choice was a wooden spoon that she carried in her apron everywhere, but was changed to a sandal at the suggestion of Lalo Alcaraz.
"Marco" didn't hide that he wanted to be a musician from his family and even had his own guitar. He was just pressured into following the shoe business, and Elena took the guitar away for the holiday.
"Marco" was only going to play guitar. After young singer Anthony Gonzalez was cast, he was rewritten to also sing.
"Marco" traveled to the Land of the Dead with Ernesto's guitar and needed it to go home. Unfortunately, the guitar had also cursed Marco's dead relatives to sing everytime they tried to talk, so they wanted to destroy it. That's right. Miguel's ancestors were the antagonists. This was changed after Ernesto and Héctor were developed in the way we know them.
Such early script had a Car Chase where the dead relatives tried to get the guitar from Marco while he was riding a bus to Plaza de la Cruz. It included a "don't talk to the bus driver" joke, the relatives' car driving off a cliff, and Marco ending at the wheel because Héctor and all other passengers had been mixed into a tangle of bones.
After rewrites, the bus became a trolley and the relatives were changed to Pepita trying to snatch Miguel, which would also have been the introduction of Alebrijes. It was later decided to introduce the Alebrijes earlier and let Miguel and Hector reach the Plaza without incident.
The "festival explanation musical" was rewritten to be Ernesto's last performance in life. However, the number always felt forced, as it was in essence Mexican characters giving a very Gringo explanation of a Mexican holiday to an in-universe Mexican audience. Furthermore, the performance was still more 1950s American than Mexican, and it failed to help test audiences understand the tradition anyway (but they found it funny). So everything bar Ernesto's introduction was cut.
The animated storyboard of this scene has Ernesto stopping in the escalator not to sing to a dancer, but to the orchestra director that later performs for him in the Land of the Dead, which implies they are friends. And you thought Miguel's Broken Pedestal was bad.
The guy who sighs at Ernesto's singing along with his date was originally a waiter who sighed after Ernesto sang past him on his way to the stage.
Ernesto is also shown to be 68 at the time of his death, while in the final film he is 46.
The papel picado was used in a musical number in the middle of the film, rather than in the introduction.
Audiences were going to meet Héctor when Miguel rode a celebrity bus tour while trying to reach Ernesto's home in the land of the dead. Héctor was the tour guide, but he was going out of business because Ernesto just forbid him from coming near his home. There were no other riders but Héctor rehearsed his routine by talking to the air.
The storyboarded version of the introduction we know had a whole bunch of skeletons with braces instead of just one, and Héctor playing Frida Kalho as arrogant, then silently trying to bribe the guard with alcohol, food, and money.
The writers struggled most with finding a way to bring Miguel back from the Land of the Dead:
Early on, the guitar was necessary to return home, and Ernesto's fall from grace happened when he broke it before his audience and gloated that "Marco" would rot in the Land of the Dead forever. The family would then come together and use their shoemaking tools to rebuild the guitar.
At another point, Miguel just needed to cross the same bridge before the holiday ended. There was a marigold sunglass that the Dead followed like a clock on New Year's Eve, and when the last petal fell, the bridge would be closed by police and start collapsing. Of course, Miguel was going to run across when the time was up and the bridge collapsed around him. Ernesto would chase and try to stop him, but he would dissolve into nothingness with the bridge. The score that plays when Miguel runs from the cemetery to Coco in the movie was composed for this sequence.
Ernesto wasn't concerned about preserving his reputation as much as not being forgotten.
The storyboard designs of the dead relatives are slightly different:
Imelda has long untied hair, with flowers and a more youthful appearance.
There is an apparent extra relative that didn't make it into the film: a younger, fat, bald guy.
The location of the Sunrise Spectacular was designed as a 19th century opera house that also mirrored the location of Ernesto's last performance in life, before being changed to a modern music venue.
Emilio Fuentes was first cast as Marco/Miguel. As production delayed, Fuentes hit puberty and was replaced with Anthony Gonzalez. Fuentes still appears as the stagehand who tells Ernesto to rush for the scenario in 30 seconds.
Angélica Vale auditioned to voice Mamá Imelda in the English version before Alanna Ubach was cast.
The "Art of Coco" book includes concept art for several skeleton conquistadors including Hernán Cortés, as well as his Nahua mistress/translator/advisor during the Spanish Conquest, La Malinche. They were presumably not included to avoid controversy.
There is also concept art of Miguel interacting with an old, short skeleton in Aztec regalia (presumably Montezuma), and another of a 'younger', taller, stronger Aztec warrior skeleton (maybe Cuauhtemoc). Word of God is that Montezuma is one of the Aztec skeletons at Ernesto's party, but they all look 'young' and of average height and built. For what is worth, the real Montezuma was 54 when he died.
The soundtrack includes a cover of "La Bikina" by Karol Sevilla that doesn't appear in the film. It is the story of proud and beautiful woman hiding her sadness for having been abandoned by her lover.