I had this rattle on the Elantra. Worse at idle would go away slightly above idle. Was really loud. Sounded like a heat shield was about to come off. I almost drove to a muffler shop since I was near it.
But I decided to have a look under it first.
I'm glad I did I would have been laughed out of the shop, or billed for a repair, or both.
This is what I found. Apparently I picked up a limb from my driveway and it threaded right though the rubber exhaust hanger. No damage just pulled it out.
So it's always worth a look first!