The Web‐of‐Things (WoT) seeks to simplify IoT management by providing an interface for controlling and monitoring the devices. To this end, it can provide several web‐based applications focused on home automation, smart cities, smart agriculture and so forth. In particular, preventing device reputation attacks, which is one of the most significant threats to the WoT, is critical when considering the huge amount of information that is generated, processed and analyzed by the network. There may be situations where intruders deploy fake devices to introduce false information, downgrading the information from valid devices for their own benefits. Different authors have proposed various security methods and algorithms using machine learning, cryptographic or semantics‐based methods. However, the existing mechanisms have various limitations in terms of accuracy, storage overhead, and computational/communication overheads, that still need to be addressed. The trusted mechanism can be considered as another way of ensuring security while transmitting the information through the Internet by identifying their legitimacy. Hence, the aim of this article is to propose a secure and trusted WoT framework using similarity index and community of interest similarity score schemes. The proposed mechanism is evaluated against existing schemes that consider both cryptographic and semantic parameters to ensure the security in the network by using metrics such as recommendations, decay time factor, and packet loss recovery rate.