In recent years, localization has been recognized as an important supporting technology for wireless sensor networks (WSNs). Along with the increase in WSN indoor applications, indoor localization has become a hot research topic and many localization algorithms have been studied. Among these algorithms, the localization method based on compressive sensing theory emerges as a popular approach to indoor localization. In this approach, the nodes are sparse when compared to the number of grids utilized to represent the locations of the nodes, so the locations are considered as sparse signal and can be reconstructed using the compressive sensing techniques. The localization problem is formulated as the sparse reconstruction of sparsifying matrix which is comprised of measurement of received signal at grids. In order to improve the localization accuracy and meet the real-time requirement of localization applications in large indoor area, an indoor localization algorithm based on dynamic measurement compressive sensing for wireless sensor networks is proposed. Using the bounding-box method, we firstly identify a potential area that possesses the independent features. Instead of using the entire node deployment region as the measurement area, our method can decrease the number of meshing and also the dimension of measurement matrix. Meanwhile, we assume that only the anchor nodes which have communication relationship with the unknown nodes can be used as the measuring nodes; the measurement matrix of unknown nodes which need to be localized can be dynamically constructed according to the potential area and the received anchor node information, and the maximum number of measurement is decided by the number of grids of potential area. The proposed algorithm can mitigate the measurement redundancy and improve the real-time feature. Simulation results indicate that the proposed algorithm can reduce the time complexity and also maintain good localization accuracy and localization efficiency.