Several industries use wireless sensor networks (WSN) for various tasks such as monitoring, data transmission, and data gathering. They find applications in the industrial internet of things (IIoT). WSNs are utilized to track and monitor changes in the environment. Since they include multiple small sensor nodes (SN), they are severely constrained, so resource management geared toward energy efficiency is crucial in this kind of network. Minimizing the power to interpret, transmit, and store data between various sensors poses important challenges. Experts have considered various ways to address these issues that unavoidably affect the network’s performance: reducing energy usage while maintaining system throughput remains the primary research issue. Another important concern relates to network security. Specifically, intrusion detection and avoidance are major concerns. In this work, we introduce the meta-heuristic-based secure and energy-efficient routing (MHSEER) protocol for WSN-IIoT. The protocol learns the forwarding decisions using the number of hops, connection integrity characteristics, and accumulated remaining energy. To make the method more secure, the protocol also employs counter-encryption mode (CEM) to encrypt the data. A meta-heuristics study designed to achieve reliable learning is used in the suggested protocol. The protocol consists of two stages. The first stage uses a heuristics method to improve the option for dependable data routing. Security based on a computationally simple and random CEM is accomplished in the second stage. The proposed MHSEER protocol has been compared to the secure trust routing protocol for low power (Sectrust-RPL), heuristic-based energy-efficient routing (HBEER), secure and energy-aware heuristic-based routing (SEHR), and secure energy-aware meta-heuristic routing (SEAMHR) in terms of packet drop ratio, throughput, network delay, energy usage, and faulty pathways. The proposed protocol increases throughput to 95.81% and decreases the packet drop ratio, packet delay, energy consumption, and faulty pathways to 5.12%, 0.10 ms, 0.0102 mJ, and 6.51%, respectively.