Will a composter help keep pests away?

Hullo

I’m a pile on the ground composter - got some good stuff last year and I add my grass cuttings too.

My entire road are having trouble with rats this year - in the houses, gardens, sheds etc. we live by fields so it’s somewhat unavoidable, but I do need to make my garden as rat unfriendly as possible.

Would one of the square composters keep them out?

Hullo

I’m a pile on the ground composter - got some good stuff last year and I add my grass cuttings too.

My entire road are having trouble with rats this year - in the houses, gardens, sheds etc. we live by fields so it’s somewhat unavoidable, but I do need to make my garden as rat unfriendly as possible.

Would one of the square composters keep them out?