Wireless sensor network (WSN) has been paid more attention by scholars due to the practical communication of a system of devices to transfer information gathered from a monitored field through wireless links. Precise and accurate data of aggregating messages from sensor nodes is a vital demand for a success WSN application. This paper proposes a new scheme of identifying the correctness data scheme for aggregating data in cluster heads in hierarchical WSN based on naive Bayes classification. The collecting environmental information includes temperature, humidity, sound, and pollution levels, from sensor nodes to cluster heads that classify data fault and aggregate and transfer them to the base station. The collecting data is classified based on the classifier to aggregate in the cluster head of WSN. Compared with some existing methods, the proposed method offers an effective way of forwarding the correct data in WSN applications.