Facebook has announced a major revamp of its advertising systems in an attempt to deal with concerns about content considered offensive.
There will now be new restrictions on where adverts appear on the site.
Marks and Spencer and BSkyB were among companies to suspend advertising after complaints that adverts had been placed on pages with offensive material.
The social network is now planning to remove any advertising from many of its pages.
Facebook's move follows complaints about a Sky advert promoting an M&S voucher.
The advert was placed on a Facebook page called "cute and gay boys". The page featured photographs of teenage boys.
In a blogpost on Friday, Facebook said: "We recognise we need to do more to prevent situations where ads are displayed alongside controversial Pages and Groups. So we are taking action."
The company said that from Monday it would implement a new process to determine which pages or groups should feature adverts alongside the content.
There will be no adverts on pages that feature any violent, graphic or sexual content, even if such content is not in violation of the company's rules.
According to one source, Facebook will create a "gold standard" of around 10,000 pages that are deemed suitable for adverts, and then inspect other pages to see if they can be added to the list. All adverts will be removed from other pages.
A spokesman said this would be a labour-intensive process but we take this" very seriously."
BskyB said it looked forward to discussing the new measures and would keep the situation under review.
M&S had asked BSkyB to remove the advert, and it suspended some of its own advertising campaigns on Facebook.
BSkyB suspended all of its advertising on the social network, where it has been a major customer.
Both companies had said they were keen to use Facebook again, but needed to be sure that their advertising would not appear next to offensive content, or material that might reflect poorly on their brands.
Speaking before Facebook announced its policy change, a spokesman for BSkyB told the BBC: "We have asked Facebook to devise safeguards to ensure our content does not appear alongside inappropriate material in the future.
"We will review the situation in due course."
Sources at Marks and Spencer said Facebook had been taking the issue very seriously at the highest level.
In an additional statement, an M&S spokeswoman said the company did not "tolerate any inappropriate use or positioning of its brand and has very clear policies that govern where and how our brand is used".
She added: "We take any suggestion that these policies are not being adhered to very seriously and always investigate them thoroughly."
Earlier this month, Facebook was forced to act against misogynist content on its site after protests from women's groups led some advertisers to suspend campaigns.