On November 24, 2017, Rivera signed a minor league contract with the Miami Marlins.[8] Rivera's contract was purchased by the Marlins on March 29, 2018, and he was assigned to the Opening Day roster.[9] On July 7, 2018, Rivera hit his first career home run at Nationals Park against Nationals starter Max Scherzer. He was outrighted to AAA on December 10, 2018.
He was assigned to Triple-A New Orleans to start the 2019 season. On August 6, Rivera was designated for assignment. He elected free agency on October 1.
Texas Rangers
On January 10, 2020, Rivera signed a minor league deal with the Texas Rangers that included an invitation to Spring Training. On August 20, 2020, Rivera was selected to the active roster. He made his season debut on August 23. On September 4, Rivera was designated for assignment after going 0 for 5 in 5 at-bats over 4 games.[10] He became a free agent on November 2, 2020.
Houston Astros
On May 8, 2021, Rivera signed a minor league contract with the Houston Astros organization and was assigned to the Triple-A Sugar Land Skeeters.[11] Rivera played in 19 games for the Skeeters, hitting .232/.250/.261 with 8 RBI before he was released on September 16.[12]
Arizona Diamondbacks
On April 1, 2022, Rivera signed a minor league contract with the Arizona Diamondbacks and was assigned to the Triple-A Reno Aces.[13] He was released on June 19, 2022.