I'd advise only trimming them when moving the plants or attaching them to a new surface. For plants with a rhizome, roots are very important and, although different plants react differently to root trimming, you might stop growth in the actual plant completely or even kill it. Maybe you could try weaving the roots around whatever piece of wood or stone they're attached to? I've never tried trimming anubias or amazon sword roots, but I did once attempt it with my java fern and it nearly killed it, so I'd definitely say don't do it.