The last year has been big for rap star Cardi B. She released her No. 1 debut album to rave reviews. She nearly broke the internet by revealing her pregnancy during a performance on “Saturday Night Live.” She landed an opening slot on Bruno Mars’ upcoming world tour.

Then in July, two weeks after she gave birth to a daughter, she made an unexpected announcement: She was dropping out of the fall tour. With a newborn, it was too much.

“I thought that after giving birth to my daughter that six weeks would be enough time for me to recover mentally and physically,” she wrote on Instagram. “I also thought that I’d be able to bring her with me on tour, but I think I underestimated this whole mommy thing.”

Supportive comments streamed in from fans, as well as from Mars (“Most important thing is you and your family’s health”) and others who were surprised to see a celebrity — especially one at the top of her game — acknowledge the physical toll of childbirth and the difficulty of being a new mom.

Cardi B and Serena Williams “have done more of late to dispel the myths and break down barriers/unmentionables around working mothers than 100,000 momblogs have done in the past 5 years,” journalist Marissa Moss tweeted.

This recent candor from Hollywood stars is a marked difference from how many celebs used to talk about pregnancy, childbirth and motherhood. It wasn’t that long ago that a pregnant starlet would drop out of the spotlight for a while, only to re-emerge in a magazine looking well-rested and snuggling with an angelic infant.

See various People magazine covers: Jennifer Lopez in 2008, resplendent in a floor-length gown with an infant nestled in each arm, above the headline “TWIN BLISS!” Angelina Jolie in 2006, gazing adoringly at Brad Pitt, as baby Shiloh snoozes away. Julia Roberts, looking dewy and fresh-faced in 2005 as she cradles her twins.

Now fans are starting to see a different side of postpartum celebrities: Model Chrissy Teigen shares an Instagram story that features her stretch marks and confesses that she’s “super insecure” about her body. Actress Olivia Wilde posts a photo of her messy bun with the caption, “I call this hairstyle ‘keep the kid alive.’ ” Tennis star Williams tweets about balancing work and tending to her daughter: “She took her first steps. ... I was training and missed it. I cried.”

Social media connections

The common denominator in all those examples is social media. The advent of Facebook, Twitter, Instagram and Snapchat made stars realize that they could connect with the public on a deeper level about personal subjects and that fans appreciated honesty about the less-than-glamorous aspects of their blessed lives.

“Social media has been such a game changer,” said Kate Coyne, executive editor of People magazine. “Celebrities are speaking directly to the fan base. Once they started doing that, things just got a lot more real. One evolution of that concept has been celebrities sharing the realities of pregnancy, infertility, child-rearing, infancy, toddlerhood.”

After all, who’s more relatable: a star who insists that the baby weight just magically fell off, or Anne Hathaway, who Instagrammed a photo of jeans cut into shorts after her son was born, because her shorts from the previous summer no longer fit?

Of course, there are some notable lifestyle differences. Celebrities tend to be wealthy, with access to vast support systems and the luxury of deciding when they go back to work. Still, everyone has the same baseline insecurities.

“Most moms have had that feeling — if you are a working mom or intend to be a working-outside-the-home mom, you inevitably feel like: ‘I’ve gotta get back out there. People will forget about me. People will replace me, I can’t let opportunities pass me by,’ ” Coyne said. Who can’t relate to that?

Sparking wider dialogue

In January, Williams told Vogue that she had a potentially fatal complication during labor, including blood clots in her lungs. At first, she said, the medical staff didn’t listen to her concerns when she said something was wrong. The story struck a chord and sparked a wider dialogue about maternal mortality rates, particularly for women of color.

“The impact that Serena Williams had in sharing her story not being trusted in her own body. ... I don’t think we can underestimate the impact of that,” said Renée Ann Cramer, author of “Pregnant With the Stars: Watching and Wanting the Celebrity Baby Bump.”

When celebrities publicly discuss these situations, experts say, it can be beneficial for all of us. Topics like postpartum depression become a little less taboo when they become part of the mainstream conversation.

“When celebrities talk about something that’s really difficult, like a mental health challenge, they’re sending a signal it’s OK to talk about these things, and these things are part of normal human experience,” said Steven Hoffman, a professor of global health, law and political science at York University in Canada.

Although he advises people to listen to their physicians, there’s no denying that stars can influence how their fans think about health.

Added Cramer: “It enables conversations that some folks just aren’t going to have. Even though celebrities are rich and famous, they’re still human.”