Present Company Excluded

A character makes a derogatory statement about a group of people, then realizes that his statement includes either one of his friends or himself, and qualifies the statement with "Present company excluded."

This is often used in passing as a throw-away gag, although occasionally more conflict might stem from it; the character it was unintentionally aimed at might still be insulted (especially if the prejudice was a long running thing), or if the sub-text seems to suggest that the speaker really did mean to offend. Often, though, the character won't seem to mind.

"Brent: But not me, right? Mayor: Oh, not you, Brent. No, you've always been Like a Son to Me."
 * In Cloudy with a Chance of Meatballs, the mayor refers to the population of the town as "sardine-sucking knucklescrapers."

"Xander: I have the worst taste in girls. Xander: Present company excluded, of course."
 * Buffy the Vampire Slayer:
 * realizes he is speaking to Buffy*

"Wash: Don't you just hate doctors? Dr. Simon Tam: Hey. Wash: I mean, present company excluded. Jayne: Now, let's not go excluding people."
 * Firefly episode "Ariel"

"Michael Knight: Well, these computer things are just a waste of time anyway. K.I.T.T.: Ahum. Michael Knight: Oh, present company excluded, of course."
 * Knight Rider episode "Deadly Maneuvers"

"Jonathan: And when those damn yanks go to sleep, no offense, Rick: None taken. Jon: We'll dig our way up and steal that book right out from under them. Rick: Are you sure you can find this secret compartment thing? Evie: Oh, yes, if those beastly Americans haven't beaten us to it, no offense. Rick: None taken."
 * The Mummy 1999, when Jonathan is complaining about the Americans in Hamunaptra, while Rick O'Connell is digging.

"SpongeBob: "We survived the horrible disgusting monsters!" Monsters (collectively): Awwww. SpongeBob: But not you guys! You guys were awesome!"
 * Happens in the SpongeBob SquarePants movie:

"Patrick: He's hideous! He makes me sick just looking at him. Those big, bulgy eyes, that square body, those two buck teeth, and that stupid tie! SpongeBob: Ahem. Patrick: Oh, but it looks good on you, SpongeBob."
 * On the SpongeBob SquarePants episode "Frankendoodle", Patrick is going on about how ugly DoodleBob (a crude drawing of SpongeBob come to life) is:

"Zapp Brannigan: Our mission is clear: destroy all alien life forms. Kif: Um, not me, sir. Zapp Brannigan: Right. Nobody destroy Kif. Unless you have to."
 * Futurama, "When Aliens Attack":

"Leela: My parents! They're coming up from the sewers for a visit Sunday. Amy: Are you off your rocket? Your parents are mutants! It's illegal for them to come above ground 'cause they're inferior genetic scum! ...Uh, present company excluded, of course."
 * Also in "Less Than Hero":

"McCoy (discussing a new crewmember): There's something wrong about a man who never smiles, whose conversation never varies from the routine of the job, and who won't talk about his background. Spock: I see. McCoy: ...I mean that it's odd for a non-Vulcan."
 * In Star Trek VI: The Undiscovered Country, one of the Klingons describes The Federation as a "homo sapiens only club", and another glances at Spock and adds, "Present company excepted."
 * There's also this exchange from the TOS episode "I, Mudd":

"Thief: "I hate wizards." (Beat) Thief: "What?" Red Mage: "I'm waiting for you to say 'present company excluded'." (Beat)"
 * Parodied in Eight Bit Theater:

"Waspinator: Waspinator detect stink of unnatural Transmetal! Dinobot II: (growls) Waspinator:...Waspinator exclude present company."
 * Red Mage then waits an hour for the Thief to say it.
 * Beast Wars

""There have to be bright women around here somewhere, with all these bright men. Where are they hiding?" Cordelia shut her mouth, as it suddenly occurred to her that Kareen might mistakenly construe this remark as a slur on herself. Adding present company excepted would put her foot in it for sure, though."
 * Averted in Lois McMaster Bujold's Barrayar, during Cordelia's first meeting with the Dowager Princess Kareen:

"Toph: I'm serious, though! I mean consider his background! He was raised by upper-class, prejudiced crazies and he still turned out pretty well, considering! Katara: Whatever. You know we can't trust people like that! Toph: AHEM. Katara: Present company exluded, of course."
 * Night Watch: the revolutionaries on the street were rather confused when Commander Vimes comes up to talk to them, instead of forming ranks against them. Reg Shoe's lone cry of "Death to the Fascist oppressors!" was quickly amended to "Death to the Fascist oppressors, present company excepted."
 * Used in this strip of Flaky Pastry, but only after three Beat Panels
 * Used in this Avatar: The Last Airbender parody/recap of "The Western Air Temple."

"Rayne: Webcomics suck."
 * Used in The Movie of Master and Commander, after Jack calls for his ship to spill the wind from his sheets, and act lubberly and panicky, like a whaler might (in order to capture the ship they are chasing). With the captain of a whaler who'd been captured by, had the ship he'd been out for two years on burnt to the waterline, and left on a small boat in the middle of nowhere to die by said enemy ship standing right beside him.
 * Similar to the Night Watch example, in Blackadder Goes Forth a suddenly revolutionary Baldrick announces to Blackadder his intention to "overthrow the hated opressors like you and the lieutenant. Present company excepted, sir."
 * Stated explicitly and unironically by Rayne Summers in Least I Could Do at a comic convention, directed at 'pathetic webcomic artists' who the author, Ryan, holds in contempt for being crappier then him.

"Twilight Sparkle: (concerning her friend Applejack) That pony is as stubborn as a mule! Mule: *snort* Twilight Sparkle: No offense. Mule: None taken."
 * The Legend of Drizzt has a few instances of this when Drizzt and his allies face off against other members of Drizzt's species. Drizzt generally isn't offended when people add the qualifier in haste, though he does care when people deliberately avoid giving a qualifier.
 * In the Justice League episode "The Brave and the Bold", when Green Lantern suggests calling for backup from the rest of the League to help with Grodd, Flash asks him if the two of them cannot take down a dumb gorilla, quickly adding "No offense" to Solovar, who was with them.
 * My Little Pony Friendship Is Magic, "Applebuck Season":

""In all such theories," said he, "One fixed exception there must be. That is, the Present Company.""
 * In the Shephard's Mind finally, he's being attacked by a shock roach, and when he guns it down, he yells "Not today you jumping thunder****! No offense Sparky." (Referring to his own shock roach).
 * Two mad scientists in Girl Genius had this discussion on dead folk.
 * It even came up in the context of "assassins at parties".
 * The Three Voices by Lewis Carroll: