He asked staff at St Mary's Primary School in Paisley, Renfrewshire, to tell the youngster not to take the bus home as he would collect her.
Instead, officials contacted the pupil's parents who confirmed that they had made no such call.
Police were informed and the school has written to parents, alerting them to the incident.
A Renfrewshire Council spokesman said: "Prompt action by staff at St Mary's Primary School has averted a potentially serious child protection incident.
"Pupils at the school are now being reminded not to put any personal details on social networking sites, especially information which could identify them or where they go to school."
Pupils have been reminded about getting to and from school safely and not giving out personal details online.
A Police Scotland spokeswoman said inquiries were continuing.