Farah was a doubt after missing the recent Diamond League in Glasgow but had been hopeful of competing at Hampden Park in both the 5,000m and 10,000m.
But he will now reset his focus on next month's European Championships in Zurich.
"I have taken the tough decision to withdraw from the Commonwealth Games," he said.
Commonwealth Games
Blake suffers shock defeat as Simbine takes gold in 100m
09/04/2018 AT 12:35
"The sickness I had two weeks ago was a big setback for me. Training is getting better here in Font Romeu but I need another few weeks to get back to the level I was at in 2012 and 2013.
"I really wanted to add the Commonwealth titles to my Olympic and World Championships but the event is coming a few weeks too soon for me as my body is telling me it's not ready to race yet. Best wishes to my fellow athletes in Glasgow."
Farah last competed at the Commonwealth Games in Melbourne eight years ago, finishing ninth in the 5000m - underlining the progress he's made to become the world's dominant long distance athlete on the track.
"It is a real blow for any athlete to miss out on a major championships through injury, but to have fought so hard to regain full fitness and to have to take such a difficult decision at this stage is particularly hard," said Team England chef de mission Jan Paterson.
Tweet: Reaction to Farah's withdrawal
Commonwealth Games
Gemili pulls out of Commonwealth Games 100m final with injury
09/04/2018 AT 07:58
Commonwealth Games
Scott upsets Chalmers to win 100m freestyle title
08/04/2018 AT 11:14