I find at this time of year if you get a rat visiting it is a bit of a problem. And I agree, I definitely wouldn’t want to put down poison or a trap, both of which potentially could kill the hedgehog. Especially as most of the hogs around at this time of year are likely to be youngsters and, therefore, smaller than some.
I have found in the past that it is usually what the birds drop which initially attracts the rats and have on occasion gone to great lengths to stop any of their food spilling onto the ground. I got a large tray (as in for carrying things, rather than what you can attach under bird feeders) and put it on top of one of the frames from those plastic greenhouses and attached the bird feeder on top. I placed it away from trees and bushes and where the rat couldn’t jump onto it and it couldn’t climb up the frame. The birds soon adapted to it. That was at a time of year when the hogs still had a fair amount of food available in the wild, so I only left food out for them whilst I was up to watch them. That meant I could scare the rat away (from inside the house) if it approached the hog food. Rats seem to be much more sensitive to slight noises, like a tap or even a key turning in the lock, than hogs are. Also, here, if there is a hog eating rats have always stayed away.
At the same time, I checked the garden for any bolt holes the rat had made and filled them in. Really just making a visit to my garden more difficult for it. Usually the rats have disappeared eventually but, to be fair, that may be because someone else has trapped or poisoned them, rather than my attempts to deter them. At least they didn’t get much food here.
This time of year when the hogs are relying on the food we put out, it is more difficult. Again, I would scare the rat away, if I saw it approaching the food bowls, but feel the hogs need access to food for more of the night than I am able to watch, so just hope the hog/s get there first.
You didn’t say whether you feed the hogs, but if not, what they pick up from under bird feeders isn’t very nutritious for them. They really need some good protein, i.e. cat/dog food or hedgehog food (there is very little in the wild for them, this time of year) You might find the rat isn’t so keen on wet cat/dog food, but you may attract cats instead. But then maybe they would catch the rat!