Concision is an obvious advantage: STFU and GTFO take far fewer keystrokes than the full phrases shut the fuck up and get the fuck out, saving the (ab)user time, effort, and—perhaps most importantly—the appearance of giving a shit. Sweary abbreviations also play a role in signalling group identity, expressing personal style, and so on, FYFI (for your fucking information).
Abbreviating swearwords like this also allows people to use a form of language they might not feel so comfortable with were it spelled out, or in contexts where the explicit forms may be too risqué. Abbreviations make it easier to say whatever TF (the fuck) you want and still not be really swearing—unless you’re the GD (goddamn) NYT. Some may wonder WTF difference it makes—just say WTH (what the hell) if you’re feeling coy or you’re a euphemising FNG (fucking new guy) still figuring out what you can get away with.
WTF normally means what the fuck, but it can also mean why, who, when, where, or even whatever the fuck, because WTF not, and WTF would insist otherwise. (WTF it can mean whether the fuck is hereby resolved.) These alternative uses are less immediately intelligible but usually obvious enough in context. Besides, ambiguity comes with the territory: FTW, normally for the win, can also be fuck the world or for those wondering, FTW.
As Ben Zimmer’s post above shows, WTF has gained nominal and attributive uses, extending its reach still further. Its popularity has led to expanded forms such as WTAF( what the actual fuck), WETF (what even the fuck), WTGDMF (what the goddamn mother fuck), and WTFO (What the fuck. Over.). It’s also commonly intensified, normally by repeating the F —search Twitter for WTFFF, WTFFFF, WTFFFFF, etc. for a flavour.
There’s a downside to its familiarity, or at least there was if you worked at the Wisconsin Tourism Federation (now Tourism Federation of Wisconsin) a few years ago, before it changed its name and logo. If you ask me, the marketing department missed a trick by not embracing this happy coincidence. They could have been all like LMFAO DILLIGAF? IDGAF (Laughing my fucking ass off. Do I look like I give a fuck? I don’t give a fuck). Instead they went FML (fuck my life) and rebranded:
The internet may have supercharged the spread of sweary abbreviations, but some are already generations old. Fubar (fucked up beyond all recognition) and snafu (situation normal, all fucked up) arose as military slang in the 1940s and soon spread to wider use, as Jesse Sheidlower’s The F-Word details. T&A (tits and ass) appeared a little later. OMFG (oh my fucking god) didn’t emerge until the 1990s—at least nowhere there’s a record of it—but OMG is almost a century old. JMJ (Jesus, Mary, and Joseph), an Irish exclamation that typically marks exasperation or surprise, is a recent innovation, as is MILF.
Fubar, milf and snafu (and snefu, with everything in place of all) are unequivocally acronyms, pronounced like ordinary words as opposed to a series of letter-names. Others vary in this respect. Some people pronounce WTF as an initialism, whereas in my mind’s ear I tend to hear the full phrase: what [or whatever] the fuck. Gretchen McCulloch has heard “dubs-tee-eff,” while Language Log reader kip says “dub-tee eff.” Gretchen also cites “ohm-fog” as a pronunciation of OMFG. Upper or lower case is a further source of difference.
Swears are abbreviated in lots of other ways too, like dafuq, effing, mofo, and fuxache, but we’ll leave that for another GDMF day. AMF!