Internet trolls, who incite others to target people online or post humiliating photoshopped images of others or create derogatory hashtags, could face prosecution in England and Wales under new legal guidelines.

Issued by the Crown Prosecution Service (CPS), the new guidance aims to help police determine whether or not to press charges against someone for their behaviour online. However, it warns prosecutors to use "considerable caution" before charging those accused of posting "grossly offensive" material online.

The new changes follow a major Childnet report this year that found one in four teenagers suffered abuse on the internet because of their gender, sexual orientation, religion, race or disability.

"Social media can be used to educate, entertain and enlighten, but there are also people who use it to bully, intimidate and harass," Alison Saunders, director of public prosecutions, said, The Guardian reports. "Ignorance is not a defence and perceived anonymity is not an escape. Those who commit these acts, or encourage others to do the same, can and will be prosecuted."

According to the new guidelines, internet trolls who encourage others to harass people online, also known as "virtual mobbing," could face court action. People, who post someone's personal information such as an individual's home address or bank details online, known as doxxing, could also be prosecuted.

Other outlawed practices noted in the guidance include "baiting" – when someone is humiliated online by being branded sexually promiscuous – as well as creating derogatory hashtags to target victims. Posting "disturbing or sinister" doctored images of someone on a social media platform is also considered illegal.

The CPS adds that in cases of "sexting" between consenting children in a relationship, prosecution should not be pursued. However, if these cases involve "exploitation, grooming or bullying," those responsible may be prosecuted.

The social media guidelines also address violence against women and girls, disabled people as well as racial, religious, homophobic and transphobic hate crime.

"We welcome the comments and opinions of communities and those affected by hate crimes to help us inform the way we deal with such cases in the future," Saunders said. "Our latest hate crime report showed that in 2015-16 more hate crime prosecutions were completed than ever before.

"More than four in five prosecuted hate crimes result in a convection, with over 73% guilty please, which is good for victims. We have undertaken considerable steps to improve our prosecution of hate crime and we are committed to sustaining these efforts."

Figures released by the National Police Chiefs' Council showed a surge in hate crime in England, Wales and Northern Ireland following the EU referendum vote. According to LGBT anti-violence charity Galop, the number of homophobic attacks rose by 147% in the three months following the Brexit vote.

Public consultation on the new CPS guidelines will last for 13 weeks.