Archaeologists have labelled a Cadbury advertising campaign urging children to go on a real treasure hunt as "intensely stupid".
The campaign calls on children to "grab a metal detector" and dig holes looking for gold or treasure.
However, Dr Aisling Tierney, an archaeologist at Bristol University, said people could be prosecuted for digging without permission.
Cadbury's said it did not condone the breaking of existing rules.
It said it was "in the process" of updating its website to make this clear.
"Archaeologists are trying to get word round ASAP that any digging within a set distance of an archaeological monument is a criminal offence, and people are prosecuted, even if they didn't know it was illegal," said Dr Tierney.
"The campaign makes it seem all treasure hunting is ok and what you find is up for grabs," she added.
Prof Dan Hicks of Oxford University backed Dr Tierney.
He tweeted that the Cadbury campaign was "immensely misguided and irresponsible".
The campaign suggests it's "probably worth a quick check" at Mooghaun Fort, in the Republic of Ireland, where gold ingots were discovered.
"To suggest 'a quick check' is intensely stupid and deeply illegal," said Dr Tierney, who said the Republic of Ireland had strict rules surrounding the use of metal detectors.
She also pointed out that the image used on the campaign was not actually Mooghaun Fort.
Prof Hicks pointed out in a further Tweet that the campaign could lead people to break the law.
Such a campaign could lead people to breaking the law by:— Dan Hicks (@profdanhicks) March 16, 2019
a) Damaging a scheduled monument
c) Theft or crimimal damage to a landowners' property
d) Metal detecting with no license (in some cases)
e) Not reporting finds of treasure within 14 days (Treasure Act 1996)
"This is a missed opportunity to connect with experts and engage children," said Dr Tierney, who has called on Cadbury to remove the content and instead direct children towards young archaeology groups.
"They could make a map leading to all the museums and explain using correct terms how to respect these items," she said.
"They could also fund some archaeology projects to make amends as some of these sites were about to be potentially damaged."
Cadbury said the campaign was aimed at inspiring families "to go on everyday adventures together".
"It was not our intention to encourage anyone to break existing rules regarding the discovery of new archaeological artefacts and we are grateful this matter has been brought to our attention," a spokesman said.