Preventing food waste is important. Analyzing the effects of food waste attitudes on urban residents' waste production behaviors is necessary to reduce food waste. As Shanghai is a mega-city with a population of 24 million people, once food is adequately supplied, more attention is paid to the safety of food in terms of quantity, quality, and nutrition. COVID-19 gave a shock to the food supply in Shanghai, which in turn resulted in food waste behavior. The moderating effect of pandemic during the COVID-19 is one that has rarely been mentioned in previous studies. An investigation of urban residents was conducted in Shanghai. A total of 1030 valid questionnaires were collected in October 2020. This study examined the influence of food waste attitudes on food waste behavior under the moderating effects of pandemic expectations, quantity safety, quality safety, and price stability using a multivariate ordered probit model. The results show that food waste attitudes had a significant negative effect on food waste behavior at a p < 0.01 level of significance, which means that the more people feel shame about food waste, the less food waste they will have. The interaction coefficient between food waste attitudes and pandemic expectations was positive at a p < 0.1 level of significance. This paper concludes with strategies for dealing with food waste in the future.