How bad is it if a sixth former makes idiotic comments — and political opponents worried about losing a seat in an election dredge them up 15 years later? If those teenage comments are given more weight than a candidate’s current views? I found out first hand.

When I stood to be a Member of Parliament, I wanted to be understood as a local lad who wanted to give something back to his home town. I had seen threats to the town’s main library and pulled out all the stops to save it, protecting a local institution and dozens of associated jobs. I had set up a non-profit to reduce crime and reoffending. As a candidate, you get limited control over how you are perceived, but I was proud of the good things I had been able to achieve, and thought it reflected well on the kind of MP I would be.

Unfortunately, in my teenage years, I also had a blog. I was fascinated by politics and I loved to write. So I did. Some of those words were thoughtful and were cited positively at the time by national journalists. But, perhaps inevitably, some of those words were adolescent nonsense. Internet arguments tend not to bring out the best in anyone, and my teenage self was no exception. And of course, any thinking person’s views change over time. The Guardian went all the way back to this blog — past the tens of thousands of words I had written since in my professional life — to portray my views in 2017.

When they emailed me about it, it was just over a week until polling day. I was knocking on doors on Hundens Lane, the sort of street a Conservative candidate might normally have ignored, assuming there were few votes there. But even as the national mood was shifting fast against the Conservatives, I was finding good support in the strongest of Labour areas.

The email asked if I stood by comments I had once made, and included a very large selection of quotes from articles that I had no memory of writing, defending everything from tougher punishment for the most serious criminals to freedom of speech for a preacher being persecuted abroad.

What did I think of these comments now? Do I stand by everything my teenage self wrote? The answer was obvious. Of course not. Even before reading the quotes I knew on how many issues my opinions had changed as I had got older.

In the end, the Guardian highlighted my comments on false rape accusations. At the time, the Blair government wanted to ban raising the sexual history of complainants during a trial as evidence that the accusation was false, and the Conservatives opposed this change. I had defended Conservative policy, and suggested an even playing field in a different direction. If the woman’s history is being used against her, I wrote, then raise the man’s history during the trial too.

15 years on, I didn’t agree with this at all. Life experience in the interim had done its job.

But even more so, I cringed in embarrassment at the attention-grabbing way I had phrased the argument. Who on earth even says “woman of low morals” (or man of low morals)? Apparently I once did. I had stood to be an MP to defend the things I actually believed in: not to defend immature scribblings that my whole adult life since had told me were nonsense.

I made clear in my response that I “definitely don’t have the same views as my adolescent self” but inevitably that was quoted at the very bottom of the article that followed, after lengthy attacks from Labour. The article headline also misleadingly implied that my comments had been about the crime itself, not false accusations.

For two long days, it was a minor media story as a number of other Labour supporting web sites began to copy the Guardian story, with similar descriptions of what I had once written. At one point, the Guardian even asked the Prime Minister what she thought at a press conference (rather than sit on the fence, she stood by me and said I had made clear my views had changed, which meant a lot).

At a rational level, I knew even then that it would make little difference to the election. All but the biggest national political stories are often ignored by the man in the street. I knew that voters were considering everything from local council failings to Brexit to how suitable Jeremy Corbyn would be in 10 Downing Street. The blog I kept as a teenager would not weigh heavily. People would see that the fierce language being used against me was coming from political opponents, not fair-minded or impartial observers. Maybe they would even be pleased to see a political candidate who had made mistakes admitting to it.

It came up just three times on the doorstep — two of them people saying sympathetically that they just felt glad what they had done as a teenager wasn’t in the media. Other candidates in marginal seats were also facing vitriol and efforts to mislead voters — it sadly comes with the territory if you put yourself forward for election. One poor candidate I knew slightly had once featured in a standard romantic comedy, and unscrupulous people within Labour were telling voters she was a pornographic actress. In practice, my work to save the local library remained a far bigger issue for voters. But even so, I did feel I was at the centre of a media storm and I slept little.

Within a couple of days, the story had gone, and within a week, the polls opened.

Until 10pm, I thought I had about a 60% chance of victory, reflecting most national opinion polls and the surge of new local support I’d picked up throughout the campaign. Then the exit poll dashed any hopes for the Conservatives in seats like Darlington. I knew I had lost at 10pm. But the result a few hours later at least showed the benefits of keeping my head. 19,400 people in Darlington had backed me to be the local MP — an extra 5,000 votes on my performance in 2015, and the best Conservative result locally since I was three years old in 1987. I was disappointed to lose, but I’d still got a result to be proud of in the context of a terrible night nationally — and had weathered the worst anyone could throw at me. Attacking your political opponent’s teenage errors may feel satisfying, but it didn’t seem to work.