Shrek, angry after the birthday party, signs Rumpelstiltskin's contract for a day as a 'real ogre', and the price is a day from his childhood. Rumpelstiltskin takes the day Shrek was born, so Shrek is erased from history and will cease to exist when the 'day' ends. Shrek finds himself in a world where Rumpelstiltskin is king, ogres are hunted, Donkey doesn't know him, Puss is a fat house cat and Fiona leads an ogre resistance and has never met him.
Shrek must find a way to undo the deal. Rumpelstiltskin's contract has a loophole: if Fiona receives true love's kiss before the day ends, the contract is voided. Shrek tries to win Fiona over and helps lead the ogres against Rumpelstiltskin and his witches. He realizes how much he loved his old life, and as he begins to vanish, he tells Fiona that the best part of the day was falling in love with her again. Fiona kisses him, which breaks the contract. The world is restored, Shrek wakes up at his children's birthday party and hugs his family, now grateful for the life he has. The final image is Shrek closing the storybook, ending the series on a note of gratitude.