Peers have targeted tech firm algorithms they say push boys to content by misogynist influencer Andrew Tate, as they defeated the government over changes to the Online Safety Bill.
Baroness Kidron, who backed the amendments, argued algorithms were not sufficiently covered by the bill.
But they could recommend harmful content to children, she said.
The government argued the changes would delay other child protection measures, but lost by a majority of 72.
“Amending the Online Safety Bill in this way will only weaken and ultimately delay protections for children in the long run, and it is disappointing that the House of Lords has voted to do so,” the government said.
The bill, which is in the latter stages of its journey to becoming law, seeks to regulate providers of user-to-user services such as social media companies, and search engines in order to protect users from “harmful” and illegal content.
Crossbench peer Baroness Kidron, who called for the changes, argued that while the bill targeted content such as harmful posts on social media, it did not address the harm caused by the way a company had designed its service.
This would include, for example, “content neutral” algorithms that “deliberately push 13-year-old boys towards Andrew Tate – not for any content reason, but simply on the basis that 13-year-old boys are like each other and one of them has already been on that site”.
Mr Tate, who is under house arrest in Romania, has been charged with rape, human trafficking and forming a criminal gang to sexually exploit women.
The influencer denies all allegations against him.
A self-proclaimed misogynist, numerous social media platforms, including YouTube, Facebook, Instagram and TikTok have banned him – with the latter saying that “misogyny is a hateful ideology that is not tolerated”.
Tate was banned from Twitter but has since been reinstated.
Baroness Kidron said in the House of Lords debate that the impact of algorithmic recommendations had “rocked our schools as female teachers and girls struggle with the attitudes and actions of young boys, and has torn through families, who no longer recognise their sons and brothers.
“To push hundreds of thousands of children towards Andrew Tate for no reason other than to benefit commercially from the network effect is a travesty for children and it undermines parents.”
Baroness Kidron also criticised other harmful design choices such as the “many hundreds of small reward loops that make up a doomscroll or make a game addictive”.
Doomscrolling is internet slang for compulsively checking for negative news on social media.
Games are regulated by the bill if they allow user-to-user interaction.
Conservative peer Baroness Harding, the former chief executive of telecoms firm TalkTalk, supported the proposals, as did Lib Dem peer Baroness Benjamin.
The peer and vice president of the children’s charity Barnardo’s said the amendments sent a “loud, long message to the industry that they are responsible for the design of their products”.
Both Liberal Democrat and Labour spokespeople also backed the amendments.
But Culture Minister Lord Parkinson said the bill made it clear “that functions, features and design play a key role in the risk of harm occurring to a child online”.
He said the government could not accept the amendments claiming the changes could “weaken” the bill or potentially allow firms to “exploit legal uncertainty”.