1) Do not donate expired food.
If it's past it's expiration date, even if it's still "probably just fine", food shelves are going to have to throw it away. Additionally, bear in mind that food doesn't go directly onto the shelves. It needs to be inventoried first. If something is going to hit it's expirantion date within the next few days, try and find something else to donate. General rule: If you wouldn't want to eat it, neither does pretty much anyone else.
2) Donate cash.
Food shelves know better than anyone the sort of things that they need, and they know how to make the money go further. This doesn't mean that you shouldn't donate food, it just means that you shouldn't go shopping FOR a food shelf.
3) Fruits and veggies.
Food shelves get a lot of canned stuff. I mean, a LOT. Bear in mind that a lot of people are trying to feed their kids. Most people would ideally serve their kids fresh strawberries versus fruit cups.
4) No ramen.
Okay, if that's what you've got, fine. It's certainly better than not donating. Just remember that pretty much everyone who donates food donates ramen. People living on food shelves are sick of Ramen. Trust me, they never want to see it again in their lives.
5) Most food shelves often take non food items as well.
Instead of giving your old household items to goodwill, or throwing them away consider a food shelf. Folks are always looking for blankets or candles or whatnot. This is exceptionally true for things people go through. Diapers are important but the goldmine is feminine hygiene products. Food shelves are absolutely ALWAYS looking for tampons.