Media playback is unsupported on your device Media caption David Cameron: "Just because something is done online doesn't mean that it's legal"

Social networking websites which do not "step up to the plate" and tackle online abuse should be boycotted, the prime minister has said.

David Cameron told the BBC that the death of 14-year-old Hannah Smith - who had been subjected to web bullying - was "absolutely tragic".

He said those running the websites had to "clean up their act" and if they did not, people should boycott them.

Meanwhile various firms have said they are removing advertising from ask.fm.

Hannah's father has said she killed herself after being bullied on the Latvia-based website and he has since called for tighter controls to be applied to social networking websites.

Clean up act

Mr Cameron said it was something he worried about as the father of three young children and that the government was looking at measures to help parents manage internet dangers - for example by introducing filters to block online pornography.

Image caption Hannah's father has called for tighter controls on websites

"It's not the case that there's nothing we can do just because it's online. I think there are some steps that need to be taken," he said.

"First of all, the people that run these websites have got to step up to the plate, clean up their act and show some responsibility.

"It's not acceptable what's allowed to happen on these sites. It's their responsibility, and those posting these hateful remarks, first and foremost.

"Just because something is done online doesn't mean that it's legal. If you incite hatred, if you incite violence, that's a crime whether you do it in a television studio, on a soapbox or online and so these people can be chased.

"If websites don't clean up their act and don't sort themselves out then we as members of the general public have got to stop using these particular sites and boycott them."

Off button

The prime minister has recently announced plans for "family-friendly" filters to be automatically selected for all new broadband customers by the end of the year .

He also said he was planning to talk to his own children about staying safe online and said parents needed to have the same conversation with their children about the internet that their parents had with them about television.

"I remember my parents being quite tough with how much television I was allowed to watch," he said.

"The off-button is a great regulator."

Ask.fm, the website used by Hannah, from Leicestershire, allows people to post comments anonymously. Her father David said he found posts telling her to die.

Police are now investigating claims her older sister Joanne has received taunts on her Facebook page.

Among companies saying they are taking steps in response to the row to ensure their advertising does not appear on the site are:

Specsavers

The Sun

Vodafone

Laura Ashley

Mental health charity Mind

'Age-old problem'

In a statement on Thursday, ask.fm again expressed its sympathies to Hannah's family and said it had been speaking to Leicestershire Police throughout the week to help officers "uncover the true circumstances surrounding Hannah's suicide".

It said it was "committed to ensuring that our site is a safe environment", did not condone bullying and had introduced "improved reporting policies" so people could report offensive comments easily.

"We are constantly working to improve our site, including its safety features... what is important to note is that the vast majority of our users are using the site appropriately and are just having fun," the statement said.

It urged people to report objectionable posts, adding: "The vast majority of our users are very happy teenagers, who use ask.fm to converse with their peers around the world about the things that interest them.

"Bullying is an age-old problem that we in no way condone - and while its evolution online is disturbing, it certainly is not unique to our site. We will continue to work with the appropriate organisations to safeguard against bullying on ask.fm"

Among organisations offering parents advice on helping their children stay safe online is Childnet International - which has its own guide for parents about the safe use of social networking websites.

Its advice to parents includes asking them to familiarise themselves with websites used by their children, to talk to children about their social networking life, in the same way they do about their normal social activities and to remind them to be careful about how much information they post online, and control who can see it using privacy tools.

The BBC also has internet safety tips for parents, including keeping children safe on social networks.