Closing out unused credit cards will undermine your credit score. It will be a short-term hit to your credit score because of what’s known as your debt-to-available-credit ratio. Basically, having open credit cards where you’re not using up the available credit — that’s good for your credit score. Closing out cards reduces that ratio.
Now the other way to look at this is, if having those open cards is going to be temptation for you to run out and spend money you don’t have, then that’s the fire you have to fight. In that case, you do want to close out those cards. Because if you use those cards to run up a bunch of debts that you have to pay back at 20% interest, that’s going to do more harm to your credit score.