Routing strategies and security issues are the greatest challenges in Wireless Sensor Network (WSN). Cluster-based routing Low Energy adaptive Clustering Hierarchy (LEACH) decreases power consumption and increases network lifetime considerably. Securing WSN is a challenging issue faced by researchers. Trust systems are very helpful in detecting interfering nodes in WSN. Researchers have successfully applied Nature-inspired Metaheuristics Optimization Algorithms as a decision-making factor to derive an improved and effective solution for a real-time optimization problem. The metaheuristic Elephant Herding Optimizations (EHO) algorithm is formulated based on elephant herding in their clans. EHO considers two herding behaviors to solve and enhance optimization problem. Based on Elephant Herd Optimization, a trust-based security method is built in this work. The proposed routing selects routes to destination based on the trust values, thus, finding optimal secure routes for transmitting data. Experimental results have demonstrated the effectiveness of the proposed EHO based routing. The Average Packet Loss Rate of the proposed Trust Elephant Herd Optimization performs better by 35.42%, by 1.45%, and by 31.94% than LEACH, Elephant Herd Optimization, and Trust LEACH, respectively at Number of Nodes 3000. As the proposed routing is efficient in selecting secure routes, the average packet loss rate is significantly reduced, improving the network's performance. It is also observed that the lifetime of the network is enhanced with the proposed Trust Elephant Herd Optimization.