The telecoms company O2 has been forced to amend its so-called “porn filter” after it inadvertently blocked access to charity sites including ChildLine, the NSPCC and the Samaritans.

The filters have been introduced by major internet service providers (ISPs) in recent weeks after demands from David Cameron that telecoms companies act to stop children “stumbling across hardcore legal pornography”.

But the changes have led to internet users being denied access to a wide range of organisations including child protection charities, women’s charities and gay rights groups. Among institutions that have found themselves subject to the blocks are the British Library and the National Library of Scotland.

Download the new Independent Premium app Sharing the full story, not just the headlines

The opt-in filters also deny access to the Parliament and Government websites and the sites of politicians, including Claire Perry, the MP who has campaigned prominently for the introduction of filters.

The level of censorship has provoked a stream of criticism on social media sites, mostly directed at O2. Bloggers who checked the status of their sites took to social media to complain that they were being blocked. Harry Clapham, whose website offers guitar lessons, complained on Twitter that he was being censored by the filter. “So a parent who opts in is safe from guitar lessons giving their kids bad dreams,” he tweeted. Another Twitter user complained that “it appears ‘parental control’ is O2’s term for ‘switch the whole internet off’.”

Myles Jackman, a solicitor who specialises in obscenity law, said: “This shows filtering does not work in the way it is intended to. It is going to over-block. The fact that it blocks all blogs if parental controls are turned on is a shocking infringement.”

O2 told The Independent on Monday that it was changing its parental control filters to allow access to some of the charities that had been blocked. “As you can appreciate there are millions of sites that exist and sometimes they can fall through the net to be categorised correctly. ChildLine, the NSPCC and the Samaritans have all now been added to the ‘allowed’ list for Parental Control,” an O2 spokesman said.

The controversy demonstrates the difficult position of ISPs in deciding which content should be censored, after the Prime Minister announced in the summer that “family-friendly” filters would be automatic unless customers asked their ISPs to allow them access to adult material. All existing customers of major ISPs will eventually be asked to choose.

O2 stressed that its parental control settings for mobile internet were designed to create a “walled garden” in which children under 12 could safely go online. “It enables us to restrict children’s web access via their mobile to a limited number of sites which are suitable for children,” the spokeman said.

Other ISPs have faced criticism over their filters, with TalkTalk blocking sex education and rape crisis sites and BT denying access to a domestic abuse helpline.

Blocked off: the affected sites

nspcc.org.uk National charity dedicated to preventing child abuse

childline.org.uk Online version of the NSPCC’s ChildLine helpline for kids in trouble, especially busy at Christmas

samaritans.org Highly regarded charity helpline is celebrating its 60th anniversary this year and also sees its greatest demand at Christmas

gov.uk Portal to a huge range of government websites

parliament.uk Democracy in action

bl.uk British Library, with details of events including latest exhibition, “Georgians Revealed”

claireperry.org.uk Devizes MP Claire Perry, campaigner for tighter controls on internet content