This is how you implement editing tweets on Twitter


Twitter CEO Jack Dorsey asked for suggestions on how to improve Twitter, and lots of great suggestions came out (better ways to cut down on harassment, trolling, and bots, for example).

The one idea that seemed to gain some traction with him was the ability to edit tweets. Currently, if you post a tweet and notice a typo, you can either let the typo stand or delete the tweet and then re-create it sans typo.

For some reason, there's a lot of hand-wringing about how best to implement an edit-tweet feature (Twitter’s Jack Dorsey says support for tweet editing is needed, but implementation questions remain), but there's a fairly easy solution ("easy" here doesn't mean the woman-power and man-power to implement it would be trivial—just that the problem-solving aspects of it don't introduce complications).

Proposed Solution

If a user tweets and wants to edit her post before anyone has liked or retweeted it, she can do so. No harm, no foul. This would be the most likely option for Twitter accounts with few followers.

If a user tweets and wants to edit her post after people have liked or retweeted it, then all the previous likes or retweets get temporarily invalidated. And then those users who liked or retweeted the uncorrected version earlier will have the corrected tweet show back up in their feed the same way they get "You might like" or "In case you missed it..." prompts now, with the option to re-retweet or to re-like. Something like "Still like these tweets...?" The liker or retweeter can then say "Oh, yeah, I like that edited version" and then redo the like or retweet... or just leave it as is.

For a popular Twitter account, this will be essentially a non-issue, as long as the tweet edit is used to correct an obvious typo and not to completely change the content.

Use Case

Celebrity tweets at 13:05 and notices at 13:10 she's made a grammatical error. By then, the tweet has already been liked by 20,000 people and retweeted 1,500 times. She makes her edit at 13:10, and all of those 20,000 likes and 1,500 retweets get temporarily invalidated. The subsequent 615,343 likes and 50,231 retweets for the newly edited tweet stand. And then the original early likes/retweets will show up in those users' feeds once to see if they approve of the new edit.

Technical Implementation

I don't know the inner workings of Twitter, but I'd imagine there's a database table for each tweet that has at least a unique tweet ID, the tweet itself, the ID of the user who originally tweeted it, and the timestamp of when it was tweeted. To implement this feature, another timestamp could be added to indicate when the tweet was last edited (null would be the default to indicate it was never edited).

There's probably also another table in the database for retweets and yet another for likes. Each of those probably already has a timestamp, so there would have to be some kind of process that gets triggered immediately when the edit is submitted that would search for records of that tweet ID that were before the edit timestamp, and then put a boolean value of true (this would be a new table field) for requires_verification for the likes and retweets tables.

There would also have to be some kind of cron job that would run periodically to see which requires_verification tweet-likes and retweets to pop back up in users' feeds, but that infrastructure is already in place for the "You might like" or "In case you missed it..." prompts.


Be a problem-solver, not a naysayer. Too many people hung up on it being done in an obvious way and then dismissing that implementation instead of thinking "Maybe there's another way." I don't claim to have the solutions to everything. In fact, I'm often in awe of the amazing solutions others come up with that I never could have, which is why I'm shocked no one (that I've seen anyway) has proposed this solution to the edit-tweets problem yet.

Leave a Reply

Your email address will not be published. Required fields are marked *