The move was made in response to recent mass shootings in Uvalde, Texas, and Buffalo. Several notable sports figures - including Golden State Warriors coach Steve Kerr - have used their platform over the past few days to plead for action to combat gun violence.
MLB's social media accounts are usually used during games to show video highlights, relay baseball statistics or exchange witty jokes with other accounts about the action on the field. On Thursday, that was replaced by posts like, "Firearms were the leading cause of death for American children and teens in 2020."
Both accounts then posted a link to the source of their information.
"In lieu of game coverage and in collaboration with the Tampa Bay Rays, we will be using our channels to offer facts about the impacts of gun violence," the Yankees said in a statement. "The devastating events that have taken place in Uvalde, Buffalo and countless other communities across our nation are tragedies that are intolerable."
The Rays also released a statement, saying that the recent shootings "cannot become normal."
"We all deserve to be safe - in schools, grocery stores, places of worship, our neighborhoods, houses and America. The most recent mass shootings in Buffalo and Uvalde have shaken us to the core. The Tampa Bay Rays are mourning these heartbreaking tragedies that took the lives of innocent children and adults.
This cannot become normal. We cannot become numb. We cannot look the other way. We all know, if nothing changes, nothing changes."
The Uvalde school shooting was particularly personal for Rays reliever Brooks Raley, who is from Uvalde and still has family who lives in the town. He attended the school where the shooting occurred.
The NBA's Miami Heat also took a different approach to raising awareness and calling for change following the Uvalde shootings. Before Game 5 of the Eastern Conference Finals against the Boston Celtics on Wednesday night, the Heat held a moment of silence in memory of those who were killed - followed by a statement urging fans to call lawmakers and demand change.
"The Heat urges you to contact your state senators by calling 202-224-3121 to leave a message demanding their support for common sense gun laws," public address announcer Michael Baiamonte read to the fans, some of whom broke into applause as he spoke.
The moment was also broadcast as part of ESPN's telecast of the game.
Parents demand answers on police response in Uvalde shooting; Biden plans visit to honor victims
4th grader played dead to survive while gunman shot classmates, aunt says
Protests and counter protests expected to continue outside NRA convention in Houston
AP Basketball Writer Tim Reynolds in Miami contributed to this story.