The 35-year-old, who won the last of his two titles at the All England Club in 2010, revealed the news on his Twitter feed.
He wrote: "Hi all, I have decided not to participate at this year’s Championships at Wimbledon and the Olympic Games in Tokyo.
"It’s never an easy decision to take but after listening to my body and discuss it with my team I understand that it is the right decision."
The world number three continued: "The goal is to prolong my career and continue to do what makes me happy".
Nadal added that the short break, just two weeks, between the French Open and Wimbledon "didn’t make it easier on my body to recuperate".
The Spaniard has always found the transition from clay to grass tough on his body and was clearly struggling physically towards the end of his brutal loss to Novak Djokovic in the semi-finals at Roland Garros.
He was notably vague about his schedule afterwards.
His exit follows that of women's world number two Naomi Osaka who said she was taking "some time away from the court" following a row over access to the media.
Nadal, who will be replaced as third seed at Wimbledon by Stefanos Tsitsipas, missed the Championships in 2004, 2009 and 2016 because of injury.
The pro will no doubt see the US Open as a better chance to win a 21st grand slam title, he's already lifted the trophy in New York on four occasions, including in 2017 and 2019.
Nadal is a double Olympic champion having won gold in singles in Beijing in 2008 and in doubles with Marc Lopez in Rio in 2016, when he also carried Spain’s flag in the opening ceremony.
“I want to send a special message to my fans around the world, to those in the United Kingdom and Japan in particular,” he said.
“The Olympic Games always meant a lot and they were always a priority as a Sports person, I found the spirit that every sports person in the world wants to live.
"I personally had the chance to live three of them and had the honour to be the flag bearer for my country.”