Starmer said that new guidelines were needed because this was just one of a growing number of such cases and there were likely to be many more.
He added: "Social media is a new and emerging phenomenon raising difficult issues of principle, which have to be confronted not only by prosecutors but also by others including the police, the courts and service providers."
Mr Starmer will hold a series of round-table meetings with campaigners, media lawyers, academics, social media experts and law enforcement bodies next month before the interim guidelines are published.
The Crown Prosecution Service (CPS) has ruled out prosecuting the man who posted offensive remarks on Twitter about 18-year-old Olympic diver Tom Daley.
In a statement, the CPS said:
“This was, in essence, a one-off offensive Twitter message, intended for family and friends, which made its way into the public domain.
"It was not intended to reach Mr Daley or Mr Waterfield, it was not part of a campaign, it was not intended to incite others and Mr Thomas removed it reasonably swiftly and has expressed remorse."
The statement continued: "Chief Crown Prosecutor for Wales, Jim Brisbane concluded that on a full analysis of the context and circumstances in which this single message was sent, it was not so grossly offensive that criminal charges need to be brought.
“Before reaching a final decision in this case, Mr Daley and Mr Waterfield were consulted by the CPS and both indicated that they did not think this case needed a prosecution."