There will be a dearth of electrical energy in the prospective world due to exponential increase in electrical energy demand of rapidly growing world population. With the development of internet-of-things (IoT), more smart devices will be integrated into residential buildings in smart cities that actively participate in electricity market via demand response (DR) programs to efficiently manage energy in order to meet this increasing energy demand. Thus, with this incitement, an energy management strategy using price-based DR program is developed for IoT-enabled residential buildings. We propose a wind-driven bacterial foraging algorithm (WBFA), which is a hybrid of wind-driven optimization (WDO) and bacterial foraging optimization (BFO) algorithms. Subsequently, we devised a strategy based on our proposed WBFA to systematically manage the power usage of IoT-enabled residential building smart appliances by scheduling to alleviate peak-to-average ratio (PAR), minimize cost of electricity, and maximize user comfort (UC). This increases effective energy utilization, which in turn increases the sustainability of IoT-enabled residential buildings in smart cities. The WBFA-based strategy automatically responds to price-based DR programs to combat the major problem of the DR programs, which is the limitation of consumer’s knowledge to respond upon receiving DR signals. To endorse productiveness and effectiveness of the proposed WBFA-based strategy, substantial simulations are carried out. Furthermore, the proposed WBFA-based strategy is compared with benchmark strategies including binary particle swarm optimization (BPSO) algorithm, genetic algorithm (GA), genetic wind driven optimization (GWDO) algorithm, and genetic binary particle swarm optimization (GBPSO) algorithm in terms of energy consumption, cost of electricity, PAR, and UC. Simulation results show that the proposed WBFA-based strategy outperforms the benchmark strategies in terms of performance metrics.