P.S. a minimum working example:
xAct`xTensor`Commutator;
xAct`xTensor`Anticommutator;
Needs["xAct`xTras`"];
DefManifold[M4, 4, {a, b, c, d}];
DefMetric[-1, met[-a, -b], CD];
DefTensor[Lm[], M4];
Lm /: ImplicitTensorDepQ[Lm, met] = True
VarL[met[a, b], CD][Lm[]]
It gives only the volume term, not the variations of the matter Lagrangian "Lm" with respect to the metric "met".