Baking is a bit of a pain when trying to swap about dairy free ingredients. One trick is to read the back of the packet of everything! A lot of baking blocks that you assume will be butter, are actually vegetable oil. The hard version of stock actually contains no dairy. The softer versions however do. The best advice here is to use vegetable oil options for baking where you can. Stork is usually my go to favourite. Tesco “Best for Baking” is contains no dairy either. However a lot of “I can’t believe it’s not butter” style products don’t have butter, but they do have buttermilk (which will still set off most intolerances) so be careful to double check those too.
The taste isn’t quite as buttery though so its not really ideal for icings or buttercream. For that I would recommend looking for lactofree butter if you can (if its the lactose you’re looking to avoid rather than dairy) but for cakes and other bits of baking, these make fine replacements.