I’m currently working on this on my 07 Ranger. It’s always done it over bumps. But it’s gotten a little worse. Pushing in the door striker just a tad helps. But that’s not really the fix. And it’s not hinge pins, either. Not unless they’re really sloppy. It’s the latch assembly hitting on the side of the striker. I added rubber with weatherstrip adhesive on the top and bottom edge of the striker towards the door. Now it’s almost perfect. Hardly does it, except sometimes over very abrupt bumps. But it’s not as loud. I’m working on getting the thickness and shape of the rubber, just right. As thick as possible, without the door sticking. I also might grind about .02” off of the back side of the striker, just past where the latch grabs, top and bottom, because I think that’s tapping on the outer edge of the latch assembly and or cutout in the door for the latch assembly. I have to take a close look at it when I have the time.
Looks like an easy fix, just need to get the details just right.