Dairy free question!

Elizabeth

So I found a really yummy sounding recipe by Mary Berry that I want to make. However it contains dairy ingredients. I noticed that when I swapped out real butter for dairy free butter to make her shortbread it really didn’t bake right, it really spread out and was a weird texture. Is there a proper way to swap out butter and milk for the dairy free options? Does anyone have any advice?