A new "eraser button" law signed by California governor Jerry Brown will help teenagers improve their online images, AFP reports.

Kids, who are prone to posting unprofessional party pictures, curse words and body shots online, will be able to permanently delete inappropriate parts of their profiles and preserve their digital footprints beginning January 1, 2015.

The law is the first of its kind and it will force sites like Twitter, Facebook and Google to help minors delete their online histories.

"This is a groundbreaking protection for our kids who often act impetuously with postings of ill-advised pictures or messages before they think through the consequences," says California state senator Darrell Steinberg. "They deserve the right to remove this material that could haunt them for years to come."

Of course, the law will only apply to kids in California, but it may encourage other states to follow suit. Social media is dangerous when you're at an impulsive age and unable to think about repercussions.

More than one teen has been arrested for something he or she has written online. Students have nearly been expelled for posting nude pictures on the Internet. A law like this might be the only way to save teens from themselves.