Ms. Leav, who lives in New Zealand, started posting her verses on Tumblr in 2012 and was stunned when they spread quickly online.

“I don’t know what possessed me to post it online, since a lot of it’s quite personal,” she said. “But it really resonated, and people started sharing it on social media.”

Her online followers — there are now about a million of them — hounded her for a print collection. So in 2013 she self-published “Love & Misadventure,” which sold 10,000 copies in the first month. She found an agent and quickly received an offer from a publisher, Andrews McMeel, which has released three of her poetry books. Those collections, with frank poems about love, sex, heartache and betrayal, have collectively sold more than 300,000 copies. “Take me someplace where I can feel something — I want to give away my heart,” one of her poems begins.

It’s hard to pinpoint what is fueling the popularity of poetry on Tumblr and Instagram, sites better known for circulating celebrity selfies and animal photos. But as with many inexplicable viral phenomena, there’s often a Kardashian sister involved.

Last fall, Khloé Kardashian shared Ms. Leav’s poem “Closure” on Instagram, where she has more than 35 million followers. That first-person poem, about the aftermath of a breakup, has received 419,000 “likes.” Ms. Kardashian’s Instagram feed also drove hordes of readers to the poetry of Robert M. Drake, whose celebrity fan base also includes Ms. Kardashian’s sisters Kylie and Kendall Jenner and the rappers Ludacris and Nicki Minaj.

A Miami poet whose real name is Robert Macias, Mr. Drake now has 1.3 million Instagram followers and a passionate print readership. In the last year, he has sold about 160,000 copies of his self-published poetry books “Black Butterfly” and “Beautiful Chaos.” “I’m still in shock that I sold so many units in such a short amount of time, and it’s poetry, a genre people don’t pay attention to,” said Mr. Macias, whose verses are often short, punchy and inspirational.