Many routing protocols have been proposed for wireless sensor networks. However, few of the existing routing protocols have considered the link quality, such as the different communication rate, different Packet Loss Ratio (PLR). As a result, the routes tend to have the shortest hop count may contain weak links, which may lead to low performance and are susceptible to breaks in the presence of mobility. In this paper, we analyze the impact of link quality in data transmission and propose a Link Quality-Aware Optimization Mechanism for routing protocols. Specifically, the link quality is measured by PLR and each sensor node upon the routes will maintain a Link Quality Table (LQ-Table) which records link quality information of its neighboring nodes. By computing to select alternative sensor nodes for data transmission, the mechanism can assist the routing protocol to avoid transmitting data through bad link and efficiently prevent intolerable delay or unnecessary energy consumption due to the bad link's packet loss. Simulation and experiment results show that our design can efficiently improve the performance of routing protocols in energy efficiency and transmission latency.