The franchise is on its last legs. Once a transgressive cultural phenomenon, it’s aged ungracefully into a cash cow that a greedy studio just won’t let die. The one-liners are stale, the supporting characters are going through the motions, and the protagonists are showing their age. They used to be chasing romance and adventure; now they’re facing down mid-life crises. The thrill vanished years ago, and all that’s left is coarseness, camp, and occasional bursts of sloppy sentimentality.

No, I’m not talking about Sex and the City 2. (What — you expected me to sit through that two-and-a-half-hour turkey?) I’m talking about its green-skinned doppelgänger, Shrek Forever After. Billed as the final Shrek installment (and let’s hope they’re telling the truth), Forever After rings down the curtain on a saga that’s probably done as much to corrupt the youth of America as all of Carrie Bradshaw’s label-worshiping and Samantha Jones’s bed-hopping put together. What Sex and the City did for the love story, Shrek has done for the fairy tale: It’s taken a classic genre and purged it of any trace of innocence, substituting raunch, cynicism, and a self-congratulatory knowingness instead, and then tying up the jaded narrative with a happily-ever-after bow.

The original Shrek was conceived as a Hollywood in-joke, a feature-length middle finger from Jeffrey Katzenberg of DreamWorks to Michael Eisner, his former Disney boss. Its villain, Lord Farquaad, was an Eisner manqué, and the script took obvious pleasure in tarting up Disney’s fairy-tale universe with potty humor for the kids, wink-wink innuendo for the grownups, and a constant stream of pop-culture shout-outs that were dated two months after the movie came out.

By that point, though, it had already made a killing at the box office, and so the inevitable sequels simply repeated the formula, taking the titular ogre and his princess bride, Fiona, beyond happily-ever-after to marriage, parenthood, and finally middle-aged ennui.

This is the jumping-off point for Forever After, which finds Shrek juggling three kids, fending off worshipful human fans, and pining for the days when he was a hated swamp creature rather than a pillar of the community. At a chaotic birthday party for one of his mini-ogre offspring, he finally snaps, channeling his suburban angst into a Revolutionary Road–style fight with Fiona and then storming off into the woods to clear his head.

Enter the villain, Rumpelstiltskin — a tiny, sharp-faced, insinuating little leprechaun, and the best thing Forever After has going for it. The Shrek franchise has produced some entertaining-enough sidekicks (Eddie Murphy’s motormouthed Donkey and Antonio Banderas’s louchely Latin Puss in Boots), but its villains have been distinctly lame. The Eisner-esque Lord Farquaad was entertaining only if you were a former Disney employee, and the vain and villainous Prince Charming from the last two installments just ripped off the oh-so-good-looking Gaston from Disney’s Beauty and the Beast, who was at once funnier and more frightening than anything in the Shrek universe.

It’s hard to generate much genuine menace, perhaps, when your franchise is a long exercise in winking debunkmanship. But this time around, they’ve found the perfect bad guy for an essentially sleazy story. Rumpelstiltskin is the used-car salesman of the forest perilous, all preening self-love and persuasive patter, hawking limited-time offers where the magic is real, but the fine print is brutal. (He’s also voiced, in a nice departure from the Shrek franchise’s usual style, by his animator rather than a big-name celebrity.)

To Shrek, he promises a single day of freedom: no wife and kids, no responsibilities of any sort, and the chance to play the fearsome monster once again. All he needs in return is a single day from the ogre’s past. A day from early childhood, in fact, so long-gone that Shrek doesn’t even remember it . . .

That day, of course, turns out to be the day of Shrek’s birth, and once he’s signed on the dotted line the luckless ogre finds himself trapped, à la It’s a Wonderful Life’s George Bailey, in a version of reality where he’s never been born. It’s Stiltskinville instead of Pottersville: The red-headed leprechaun wears the crown (and a number of sky-high wigs), Oz-style wicked witches guard his castle and do his bidding, ogres are enslaved and persecuted, and none of Shrek’s old friends recognize him.

The only way out of this nightmare, the “exit clause” in Rumpelstiltskin’s contract, requires Shrek to achieve true love’s kiss with the alterna-universe version of Fiona. The good news is that she’s alive and leading the ogre resistance. The bad news is that she doesn’t know Shrek from Jeffrey Katzenberg, and he has only the one day to lock lips with her before the contract expires and he pops out of existence entirely.

Everything that follows is predictable: some action sequences, some schmaltz, and a whole lot of self-congratulatory parody. (I have a horrible feeling that the Shrek franchise offers millions of kids their first exposure — and worse, their last — to the Brothers Grimm and Charles Perrault.) When Rumpelstiltskin was capering about on-screen, I did manage to enjoy myself a little. And when he wasn’t, I busied myself imagining a world where this misbegotten series had never even been conceived.