Police are asking parents to accompany their children when using the public toilets in Monkton Park, Chippenham, after three men were encountered having sex inside.
A man out walking his dog was disturbed to walk in on the men in the act in the early afternoon.
They mistakingly thought he had come to join in their activities.
He reported his discovery to the police, fearing if it had been an hour later the men could have been seen by a child coming home from school.
PCSO Ali Duncan at Chippenham Police Station said: “We have had reports of men hanging around outside the male toilets in Monkton Park and then going inside together. Last week one man informed us he had seen them engaged in sexual activity.
“We will be actively patrolling the area and would ask parents to make sure they accompany their children to the toilet until we find the offenders.
“We urge members of the public to call 101 immediately if they see people hanging around outside the toilets. Any distinguishing features they can report to us would be helpful.”
The Wiltshire Council-run toilets are near the golf course.
Wendy Claridge, owner of the Tenth Hole Tea Room, said: “I know there’s a lot of stuff going on in there that shouldn’t be.
“They are definitely nothing to do with us.”