Facebook on Tuesday announced changes to how it handles the profiles of users who have died, including using artificial intelligence to help keep the profiles of deceased people from showing up in places that might cause distress.

Facebook is also creating a separate section on profiles of the deceased that will be dedicated to tributes. By clicking on different tabs, users will be able to switch between the deceased person’s preserved, original timeline and a second feed where others have left memories, photos or other posts in remembrance.

The automated changes will prevent recommendations that a person who has passed away be invited to events or sending reminders that it is the person’s birthday.

The changes are based on the feedback the company has received from users, discussions with experts in grieving, and people from various religious and cultural backgrounds, as well as the personal experience of Facebook’s chief operating officer, Sheryl Sandberg.

Sandberg’s husband, Dave Goldberg, died suddenly in 2015. Though she’s the No. 2 executive at Facebook, Sandberg didn’t have the power to keep her late husband’s name from appearing on the platform in unexpected places. The network’s systems weren’t designed, for example, to take death into account when making friend suggestions.

“We weren’t able to really distinguish sometimes when someone was alive years ago,” Sandberg told NBC News in a phone interview.

“And so it would show up as if he were still alive, or suggest a friend, and there were things that were happening that I think were really painful,” she said.

Sandberg said the updates resonated with her more than typical product updates at Facebook.

“This is very, very close to my heart and really matters,” she said.

Facebook has for years wrestled with how best to treat the profiles of people who have died. In 2015, the social network introduced a feature to let people choose a “legacy contact” — someone to take control of their Facebook account when they die.

The service has an online form where family or friends can submit documentation that someone has died. Once the account is “memorialized,” the legacy contact can change the person’s profile picture, pin a post to the top of their profile and respond to new friend requests.

Under the new features, the legacy contact will have expanded administrative authority. For example, they’ll be able to moderate posts shared to the new tributes section, Facebook said.

More than 30 million people view memorialized profiles every month, the company says.

Sandberg, who co-wrote a best-selling book, Option B, about her husband’s death and how to rebound from adversity, said she still relies on his Facebook profile to remember him and preserve tributes to him.

“In those early days, so many people tell you so many stories, and I was absolutely in a shock and in a fog, and I would never remember all the details of all those stories or even who said what at that period in time, but I asked people, ‘Write it down, put it on his Facebook page,’” she said.

“The memories are there, and the person who wrote them is there, and I can call them and ask more questions, and it’s all there for my children,” she said.