render only shadows on an object

i am trying to find a quick way to render an object in front of a wall, but in the final render i want the wall to not be seen. i want only the object and its shadow on the wall. over alpha… i know i have done this before but for the life of me i cant remember.

What render engine are you using?

ya that would help.
Cycles

Try this tutorial. It looks to be what you’re looking for.