This paper presents a method to enhance energy efficiency in wireless sensor networks (WSNs) by implementing geofencing and false data blocking to address vulnerabilities from false positive and negative attacks. The proposed approach reduces unnecessary energy consumption while maintaining security strength, achieving a reported 17% energy savings compared to existing methods. Experimental results demonstrate the effectiveness of the method in securing the network against attacks while optimizing energy use.