This paper proposes a new algorithm to find and isolate the nodes which lies about their position in a
Wireless Sensor Network (WSN). Also the proposed method enables the sensor nodes to find their location
in presence of liar nodes. In the proposed method, a given number of neighbors for all sensors is
determined wherethe number of liars is below a predefined threshold value. The proposed method is
evaluated in finding the liars and also the correct location of each node. The minimum error rate on the
determination of liars and the location of sensors proves the ability of the algorithm for localization of
sensors in the WSNs.