In Shrek
The three pigs and the wolf appear in the four Shrek films, and the specials Shrek the Halls and Scared Shrekless.
In the book and first film, they are among the many fairy tale creatures banished to Shrek's swamp by Lord Farquaad. The pigs have German accents.
They have a larger role in Shrek 2. They are friends with Shrek prior to the events of the film. In the beginning, they housesit for Shrek and Fiona while they visit the Kingdom of Far Far Away. Later, they see Shrek, Donkey and Puss in Boots arrested in Far Far Away and free them, then head to the castle to stop Prince Charming. They stop The Fairy Godmother's scheme and celebrate. They sing a song together, "Far Far Away Idol".
They are less prominent in Shrek the Third. They appear at the start, heckling Prince Charming (now a dinner theatre actor) off the stage. They appear in the castle, pretending to have tea with the others, while the heroes find Artie, the kingdom's heir apparent. Under pressure, one pig reveals Shrek's plan to Prince Charming and the four are imprisoned. They are later freed and head to the castle to stop Prince Charming from killing Shrek in his show.
In Shrek Forever After, they are at the ogre triplets' birthday party, and eat the occasion cake. In the alternate universe, they are attendants to Fifi in Rumpelstiltskin's castle.
Read more about this topic: Three Little Pigs