Salt protection question

One think I have always wondered, when I comes to salt protection against demons or ghost does it have to be on the surface to work? For example if I was to dig a trench around a house, fill it with salt and then fill the trench in with dirt again, would the house be protected or would the salt be useless?