Want to get rid of shitposting? Get rid of the shit posters. It's that simple.
Or, you know, maybe a less extreme solution like using the ignore feature.
If you read some of the exchanges I had with obbe recently, I noted that many times, just asking everyone in the thread 'can we get back on topic?' works at least temporarily to get the discussion going again. If someone is repeatedly derailing the thread, just ignore them. If they end up having something to say later that adds to the conversation, and no one reads it because everyone has them on ignore, well that is just too bad.
That, as well as the disdain shown towards immature, derailing users by a sizeable portion of the users (need I mention tacho aka 'train'?), pretty much keeps everyone in line without moderators having to hover over everyone's conversations like a hawk, waiting for someone to post some one-liner or someone to report a post for them to delete.