How to make background apps/ automatic apps use only wifi for data?
/system/bin/iptables (usually built in) is the tool, but I prefer a graphical frontend for it such as AFWall+ which is available from the Play store or F-Droid.
If you are going to be using TOR then OrWall should also work, but I haven't tried it.

These tools show one app per row &amp; columns for the interfaces you wish to allow them to use &amp; you just tick the boxes.