When I was a teenager, a strange rumour began to circulate around the small Scottish seaside town where I lived. Roadworks were demolishing the corner of an ancient churchyard, in order to widen the road. The site, long since abandoned, dated back to the 1600s, and contained a picturesque, ivy-clad ruin, open to the sky. It was a place much frequented by tenebrous adolescents like myself. The story was that several of the workmen had come down with a mysterious illness: fever and swellings in the lymph nodes. It was digging up the graves, we told each other, with gothic relish. They got the bubonic plague! It will spread! The whole town is going to die!

It didn’t, of course. The roadworks stalled briefly, a lurid fence around them, but nobody contracted the Black Death. Slightly disappointed, we kept going to school, and life carried on much as before.

Even now, whenever I pass that graveyard, the roofless church still draws my eye. And I think about those deeply buried 17th-century people, packed like tubers into the earth beyond the rebuilt wall. Did they die of the plague? Did the bacterium Yersinia pestis lie dormant in the soil for more than 300 years, only to infect some hapless workmen? Newly curious about contagion and its attendant fears, I call my scientist sister and ask her if she remembers any of this. She does but is quick to discredit it. “The bacterium would have died shortly after the person,” she says. “Digging up graves is never really a risk.”

Truth versus teen hysteria aside, what is clear from this story is that our collective memory of that particular pandemic refuses to fade. The disease variously known as the plague, the Black Death, the pestilence, or the bubonic plague, occupies a potent and febrile space in our minds and in our thinking about infection. The first song you ever learned, for example. What might that have been? It could have been “Row Your Boat” or perhaps “Pat-a-Cake”, but there’s a strong chance it was “Ring a Ring O’ Roses”.

The tune is eerily, maddeningly anodyne, employing the same circling three notes for the initial couplet, the words of which, some believe, are about the most devastating pandemic ever to sweep the globe. The “ring o’ roses” refers to the distinctive red marks on the skin, caused by the disease; carrying a posy of flowers was thought to ward off miasmas. The final lines – “atishoo, atishoo, we all fall down!” – are grimly self-explanatory.

Ring o’ Roses by Thomas Webster. Photograph: Sepia Times/Universal Images Group via Getty Images

I have strong memories of singing it, with blithe gusto, in the classroom, in the playground, at birthday parties, at Sunday school. With clasped hands, we all formed a circle until the closing words, when the connections were broken and we threw ourselves to the floor, alone and untethered. We had no idea what we were enacting. When I was working as a teacher in Hong Kong in the mid-1990s, this rhyme came up in a textbook. With the zeal of the recently qualified, I taught it to the class, getting them to mimic me as I did the actions. I then explained what it meant, thinking that they might find it interesting. But the classroom fell profoundly silent as 20 or so Hong Kong Chinese students stared at me in dismay. Why, they wanted to know, did British children sing about something as horrible as the plague?

My pupils had a point. The Black Death is no child’s play. The most infamous outbreak originated in China in 1334 and rapidly spread along trade routes, reaching Europe in 1340. It would kill an estimated 25 million people, a third of the world’s population. It continued to raise its hideous head at intervals over the ensuring centuries. London suffered a prolonged outbreak from 1665-66, as documented by both Samuel Pepys and Daniel Defoe, who was a child at the time. More than 70,000 Londoners died during this two-year period; at the epidemic’s height, more than 2,000 plague deaths were recorded in a single week.

When I began to write Hamnet, a novel about Shakespeare’s lost son and his link to the play Hamlet, I knew I would need to grapple with the spectre of the plague. It was an ever present threat for Elizabethans. The shadow of this disease shaped and defined their lives. They would have been all too familiar with its symptoms and signs: the black crosses on the doors, the cries of “Bring out your dead!”, the death carts, the watchmen posted at city gates and outside infected houses, and the chilling sight of plague doctors. These were men in long robes and sinister beaked masks – the cone of which was stuffed with herbs– and armed with long sticks, used to “examine” their patients from a purportedly safe distance.

In the Stratford-upon-Avon parish register for July 1564, three months after the baptism of a certain William Shakespeare, there is an entry of three words: Hic incipit pestis. Here begins plague. In the ensuing six months, just over a tenth of the town died – 237 people, four of whom lived on the same street as the Shakespeare family.

Shakesepare’s working life, as both playwright and actor, was repeatedly disrupted by it. Whenever an outbreak of what was known as “the pestilence” occurred in London, almost the first thing the authorities did was to close the playhouses in an attempt to prevent the spread of infection. So, for long months, Shakespeare and his company were forced to shut up shop and tour their productions in smaller towns, in Kent or Shropshire. Edward Alleyn, while on tour in Bath, wrote the following solicitous instructions to his wife: “Every evening throwe water before your dore … and haue in your windowes good store of rue.”

If the coronavirus teaches us anything it is that nothing is stable, that our situation must be reassessed every day

In order to write Hamnet, I had to put myself inside the skin of a 16th-century mother who realises that a terrible illness has entered her house. Two or three years ago, when I began the novel, this was purely an exercise of the imagination. The concept was so alien to me, then, so out of reach. What might it have felt like, I speculated, as I sat in my ergonomic chair in my centrally heated house, to know that a fatal disease could at any moment be sweeping towards you, from far off continents? How might you react if you thought it had entered your town, your street, your house?

I resorted to research: I examined maps of Elizabethan trade routes; I plotted where spices and perfumes would have been picked up, and where they might have been exchanged for furs or silks or gems; I read up on the lifecycle of the flea, and marvelled that it can live for up to a year. No wonder the disease spread so fast. I used this knowledge to write a chapter that traces the journey of an infected flea from a monkey in Alexandria all the way to a seamstress in Warwickshire.

And now I find myself once more studying maps and infographics of infection. Here again are the red arrows of contagion, sweeping across lands and seas; here are peaked graphs of deaths; here are lists of symptoms; here again are people walking about cities with masks covering their faces. Except this is not the distant past, this is not the Black Death, and this is not for a work of fiction. It is, unthinkably, the here and now. It is us, our neighbours, our children, our parents. Hic incipit pestis.

If this coronavirus crisis teaches us anything it is that nothing is stable, that our situation must be reassessed every day, sometimes every hour. The disease won’t reach us, we are told, and then it does. The schools will not close, we are told, and then they do. The lockdown will not happen, then it does.

‘By the time this pandemic has passed, the world will be different. And so will we’ ... Maggie O’Farrell. Photograph: Pako Mera/Alamy Stock Photo

I’ve read that in times of trauma, the brain performs a scan for similar or parallel experiences, the better to inform itself of means of survival. Perhaps, in coping with Covid-19, we are looking to ingrained history lessons about the plague. If disease threatens to invade, these half-remembered practices are telling us, put on a mask. Shut your front door. Keep your loved ones close. Bury your dead quickly and without ceremony. Leave the city, if you can, and if you can’t, stay at home. Above all, keep going. This devastating pandemic of the past has irreversibly shaped our thinking about contagion. The plague, whether we are aware of it or not, is woven into our language, our communication, our very geographies.

Why, for example, do we say “bless you” if someone sneezes – a verbal reflex that crosses all cultures and languages? Because of the Plague, a sneeze being the first sign of an illness that could end a life in 24 hours. Why do we give flowers to sick people? Because of the ancient belief that the proximity of certain plants offers protection from infection. Why are cats traditionally associated with witches? Because when cat populations rose, the cases of the plague dipped and somehow from this arose the skewed logic that cats were consorts of Satan. In his diary, Pepys noted that around 200,000 cats were killed in London, by order of the mayor. It’s not hard to imagine what effect this had on the number of flea-bearing rats. Why do we currently wear masks, like those long-ago, questionably qualified plague doctors? Advice on their effectiveness varies, but still we cling to them, almost as talismans. When conventional medicine fails us, perhaps we too are prone to fall back on superstitions and charms.

The Black Death is responsible for the layouts of our cities, the very streets on which we live. Plague is a decisive town-planner, the endoskeleton of urban life, especially for green spaces. Islington Green, Golden Square, Green Park, Shepherd’s Bush Green, Vincent Square, Christchurch Gardens: all these are reputed London plague burial grounds and have remained undeveloped because of the mass graves beneath. The engineers of Crossrail unearthed some 14th-century plague graves near Charterhouse Square as recently as 2013. You can hear it in the city’s street names, too: Pitfield Street, Vinegar Alley, Pesthouse Close, Holywell Mount.

My children, as yet, have no idea why an area of the Edinburgh park in which they regularly play has intriguing dips and hummocks. Up and down, up and down go the miniature grassy drumlins, said to contain thousands of plague corpses. If you build a snowman in one of the hollows, it will still be there long after all the other snow has melted, almost as if they possess their own sub-zero microclimates.

It would have been unimaginable to the citizens who dug these pits that the sites would in time become leafy grounds of leisure. Equally unthinkable would have been a song about the plague becoming a birthday party favourite, just as we would find it unsavoury to picture future children singing rhymes about the pandemic of 2020. Will games be played about coronavirus, will teenagers frighten each other with tales about it, will museum displays be made of our surgical masks and bottles of hand sanitiser?

Impossible to say, of course. What is certain is that, by the time this pandemic has passed, the world will be different. And so will we. Like the Black Death, Covid-19 makes no distinctions; it shows no mercy; it does not recognise borders, superstitions or, in some cases, treatment; it is the ultimate leveller.

Any person who has come through a severe illness will know that the experience changes you for ever. You emerge from your sickroom as one who has passed through fire, recast, all too aware of both your frailty and your strength. In the same way, a population that goes through a crisis will also be changed, and the coming generations will inherit this sensibility. We will emerge from this but we will be different, depleted, forced to make ourselves anew. We will never be able to go back to a time before this pandemic, to a time of security and confidence, when we thought we were inviolate, immune. We will carry this with us, always; we will never be able to forget.

• Hamnet by Maggie O’Farrell is published by Tinder (£20).

