The singer and actress will be playing a character in the movie, which begins production later this year.
In an interview with The Sun, a friend of the star said, "Madonna fancied doing something totally different and this sounded like so much fun."
"She is a fan of Shrek and thought Antonio was the best thing about the sequel."
"She has two young children and sees how much they love the films."
Madonna is also planning to work on another animated film…the screen adaptation of her children’s book, The English Rose.