Barry Stewart failed to notify officials at the Department for Work and Pensions (DWP) that his financial circumstances had changed because his spouse had begun paid employment.
For nearly two years the 42-year-old claimed fortnightly Income Support payments while his partner Janine Fraser paid the household bills.
He was caught after investigators were tipped off that his family finances had changed dramatically, Livingston Sheriff Court heard.
Stewart, of Braehead Terrace, Linlithgow Bridge, was originally charged with defrauding taxpayers of £36,457 over a four year period.
But the prosecution accepted his guilty plea to obtaining £18,000 which he wasn’t due between January 2014 and January 2016.
Gerry Bann, defending, claimed his client suffered various health issues which had contributed to his “inactivity” in telling officials.
But he admitted Stewart had been well aware of the need to notify the DWP promptly of any change in his finances.
He said: “He’s struggled with his mental health and he’s struggled with drug addiction and that’s been exaggerated by the stress surrounding this present case.
“Heroin has been something he’s resorted to when I think pressure and anxiety takes over.
“He has repaid something in the region of £1300 over the last two years.”
Mr Bann added: “There is no indication his medical problems are so chaotic that he wouldn’t be able to carry out unpaid work.
“In fact his doctor has said that unpaid work would be significantly more beneficial than a prison sentence.
“A community sentence would be right for the court, right for justice and right for Mr Stewart.”
Sheriff Jamie Gilmour imposed a community payback order placing Stewart under social work supervision for 18 months and requiring him to carry out 300 hours of unpaid work.
He warned Stewart: “If you breach the order the likely outcome will be a custodial sentence.”