We study Hankel operators and commutators that are associated with a symbol
and a kernel function. If the kernel function satisfies an upper bound con
dition, we obtain a sufficient condition for commutators to be bounded or c
ompact. If the kernel function satisfies a local bound condition, the suffi
cient condition turns out to be necessary. The analytic and harmonic Bergma
n kernels satisfy both conditions, therefore a recent result by Wu on Hanke
l operators on harmonic Bergman spaces is extended.