Did the character exist before the movie?
Yes. Shrek was a 1990 children’s book written and illustrated by 83-year-old William Steig.
The book was quite different from other children’s book. Said one article:
…Shrek! in particular inspires a subversive hope: it pushes kids to question the moral and sexual subtexts of fairy tales they’ve been fed their entire lives. Instead of undergoing a Beauty and the Beast-esque transformation set to the sounds of Celine Dion and Peabo Bryson, Shrek learns to embrace his own hideousness and finds himself an equally grotesque ogre bride. They get a dragon to oversee their nuptials (another villain-reversal) and live freakily-forever-after. In the book, Shrek was an outsider-turned-hero who taught kids it was OK to be different.
The film rights were purchased in 1991 by Steven Spielberg, but never progressed. Dreamworks ended up making the famous movie in 2001.
Why I Looked It Up
I was watching a video about 75.5 Bedford Street, which is the narrowest house in NYC. It has been home to many notable people over the years. The narrator mentioned that Steig had lived there in the 1930s, and that he was “the author of Shrek.” I only knew the character from the movie, and got to wondering if the character existed before then.