The content is accurate at the time of publication and is subject to change.
This depends on a credit card. As a rule, Walmart and some other big-box retailers are not considered a grocery store for credit cards because they sell a lot more than groceries. Therefore, Walmart purchases won't earn elevated rewards on groceries but can earn standard 1% back on all purchases.
However, there are Walmart Neighborhood Markets and they are considered grocery stores for credit cards. Purchases at such locations should earn rewards on groceries.
If you want to earn increased rewards on Walmart purchases, look for credit cards that offer elevated rewards on Walmart purchases specifically. For example, it can be a Walmart credit card or the Discover it® Cash Back credit card. The last one will give 5% cash back at Amazon.com, Walmart.com, and Target.com from October 1-December 31, 2021, on up to $1,500 in purchases (activation is required).