The posts made by Antony Calvert, the Tory candidate for Wakefield, were revealed on Friday and on Saturday he said: "While I would prefer to stand and fight the assertions these comments represent either my views or those of the Conservative Party, I accept that to do this would simply create a distraction from the very serious issues being discussed at the General Election."
A number of inflammatory social media posts were revealed, including one criticising the looks of Labour's candidate, Mary Creagh.
In one post, from 2010, he said: "Can't believe just how shocking Mary Creagh looks on TV. Obviously the BBC make up dept don't work on Sunday."
While in another from 2011 he said if former Libyan leader Colonel Gaddafi wanted to "wander the streets unrecognised he should surely have fled to Bradford".
After Ms Creagh posted on Twitter and said "there is no place for racism in Wakefield", Mr Calvert replied: "There is not a racist bone in my body. These outrageous insinuations are absolutely beneath contempt.
"Taking and distorting comments made almost 10 years ago on Facebook speaks volumes for just how desperate her, and Labour's, campaign is."
But he has now been forced to stand down and said: "Over the last 24 hours a number of very historic posts from my personal Facebook timeline have been featured in the news media. They included comments between me and friends going back almost 10 year, well before I was first a candidate for the Wakefield constituency. These comments were certainly not intended to cause any offence."
Mr Calvert was not the Wakefield canddiate 10 years ago but he did contest the 2010 election for the Tories in nearby Morley and Outwood. He secured 17,264 votes and only lost to Ed Balls by 1,101 votes.
Mr Calvert will be replaced by Imran Khan, a counter-terrorism expert who went to Queen Elizabeth Grammar School in Wakefield. His father was a consultant dermatologist in the city and his family still lives in the area.
It is understood the decision to step down was taken Saturday morning, with Mr Khan selected the same afternoon.
Ms Creagh said: “It is absolutely extraordinary that this person stood as a Conservative general election candidate in 2010, 2015, 2017, and 2019."
“It raises serious questions about why they tolerated his abhorrent views on race, women, and poor people for so long. Will the next candidate they parachute in be any better? Don’t hold your breath.”
Mr Calvert added: "I am not prepared to countenance a situation where the Conservative Party is even marginally distracted from the key themes of the election. My sole ambition in politics has been to return a Conservative MP for Wakefield that can make an authentic and last contribution for my home city in Parliament.
"If my continuing in this role will jeopardise this at all then I have concluded that I must stand down.
"This is a difficult decision for me but I am very grateful to the national and local party for all their support. It goes without saying that I wish the new candidate well."