SummaryIn recent years, the use of wireless sensor devices in several applications, for example, monitoring in dangerous geographical spaces and the Internet of Things, has dramatically increased. Though sensor nodes (SNs) have limited power, battery replacement is not feasible in most cases. Therefore, energy saving in wireless sensor networks (WSN) is the major concern in the design of effective transmission protocol. Clustering might lower energy usage and increase network lifetime. Routing protocol for WSN represents an engineering area that has gained considerable interest among researchers due to its rapid evolution and development. Among them, the clustering routing protocol corresponds to the most effective technique to manage the energy consumption of each SN. In this manuscript, we focus on the design of a new metaheuristic optimization‐based energy‐aware clustering with routing protocol for lifetime maximization (MOEACR‐LM) method in WSN. The purpose of the MOEACR‐LM method is to improve network efficiency via proper selection of cluster heads (CHs) and effective data transmission. Initially, a hunter–prey optimization (HPO) method‐based clustering technique is used for cluster construction and the CH selection process. Next, the clouded leopard optimization (CLO) model is used for the route selection process in WSN. The HPO and CLO models derive a fitness function involving multiple parameters for clustering and routing processes. A comprehensive experimental analysis is carried out to demonstrate the enhanced performance of the MOEACR‐LM technique. The overall comparison study pointed out the improved energy efficiency results of the MOEACR‐LM technique over other existing approaches.