Gary Edge, 46, of Swaledale Road, Warminster, was sentenced to eight months in prison, suspended for two years, at a hearing at Salisbury Crown Court
He must also comply with a six-month alcohol treatment requirement, a 20-day rehabilitation activity requirement and pay a victim surcharge of £156.
Edge will also be on the Sex Offender’s Register for 10 years and a sexual harm prevention order for 10 years.
Wiltshire Police received information that between March and May last year, Edge had been conversing with what he believed to be a 14-year-old girl.
The girl – an adult decoy posing as a teenager – had informed Edge that she was only 14, but he continued trying to engage her in a sexual conversation.
Edge was arrested in June 2022 and was subsequently charged with the offences.
DS Sam Hopkinson from CID said: “I’m pleased that Edge has been sentenced and has been given a lengthy sexual harm prevention order and must be on the Sex Offender’s Register for the next decade.
“Wiltshire Police is completely committed to protecting children from sexual abuse and those who seek to do them harm.
“While there was fortunately no victim in this case, I would like to take this opportunity to encourage anyone who has suffered a sexual offence to please come forward and speak to us as soon as you can.
“Our specially trained officers will treat you with sensitivity and compassion.
“I would also urge anyone who has concerns that a child they know may be being abused or exploited, to report this to us.
“You can find out more information here: https:///www.wiltshire.police.uk/advice/advice-and-information/caa/child-abuse/.”