The best substitute for cooked shallot is yellow onion. If you're using raw shallots, replace them with red onion. You can replace it 1:1 as long as you measure in grams or teaspoons.