The draft code, which has been compiled by the Information Commissioner's Office, says tactics such as the like function and Snapchat streaks are used to keep under-18s online for longer, Sky News reported.
It suggests 16 online standards which social media companies should meet, including that settings should be set to "high privacy" by default, unless there is a compelling reason not to.
The code also says firms should not collect unnecessary personal data.
Information Commissioner Elizabeth Denham said, "This is the connected generation. The internet and all its wonders are hardwired into their everyday lives.
"We shouldn't have to prevent our children from being able to use it, but we must demand that they are protected when they do. This code does that."
The National Society for the Prevention of Cruelty to Children (NSPCC) welcomed the guidelines and said social networks "continually failed to prioritize child safety in their design" which resulted in "tragic consequences".
The charity's head of child online safety, Andy Burrows, said, "That's why it is vital this code requires children to be given the highest privacy settings by default and forces firms to act in the best interest of children."
Baroness Beeban Kidron, chairwoman of the 5Rights Foundation, said social media companies have "failed to recognize child's rights and needs online".
However, others argued it should be the responsibility of parents to keep their children safe online.
Matthew Lesh, head of research for the Adam Smith Institute, criticized the proposal to set privacy settings at their highest by default.
He said, "The ICO is an unelected quango introducing draconian limitations on the internet with the threat of massive fines.
"It is ridiculous to infantilize people and treat everyone as children."
A report by the children's commissioner for England last year found that social media sites were collecting information about children from birth.
In January, children's commissioner Anne Longfield urged online platforms to take more responsibility for the "horrific amount of disturbing content" children can access on the internet.