Sales volumes were higher by 2.3% compared to pre-coronavirus (Covid-19) levels in February 2020, but were still down over the past year.
During the month, sales volumes for non-store retailers, which consist mostly of online retailers, rose by 4.8%.
According to online retailers, sales were boosted by a range of promotions during the month.
Sales volumes at non-food stores fell by 0.7% in July, impacted by a 1.5% drop in other non-food stores and a 1.2% decline in clothing stores.
Food stores saw their sales volumes grow by 0.1% over the month, but these were still 0.1% below their February 2020 levels.
The proportion of retail sales online rose to 26.3% during the month, compared with 25.3% in June.
In the three months to July, sales volumes declined by 1.2% against the previous three months.
British Retail Consortium (BRC) chief executive Helen Dickinson said: “The summer sunshine brought a slight uplift in sales.
“Summer clothing, air conditioning appliances and outdoor foods all benefitted from record temperatures, but most retailers will still be seeing falling volumes in the face of rising inflation.
“Consumer confidence has hit new lows as inflation soared past 10% and talk of a recession has grown.
“The Bank of England expects inflation to reach over 13% in October when energy bills rise again, further limiting discretionary spending for struggling households.
“For many businesses, 2022 is proving to be every bit as challenging as the pandemic.”
Last month, the BRC reported that UK retail footfall had improved by 2% from May and was better than the three-month average decline of 11.8%.
Total footfall was down by 10.5% compared with the same period three years earlier.