This paper proposes mobility-enabled and loop-free extensions to the Spanning Tree Protocol (STP) for wireless ad hoc environments, taking into account requirements such as loop avoidance, root selection, ability to deal with interference, path loss or multipath fading, all without requiring to modify the existing protocol stack. Our approach is compliant with IEEE 802.11 networks and considers that mobile nodes constantly join and leave the range of each other due to their unpredicted movements, often changing the network topology. This implies that coherent information must be forwarded between nodes in order to keep their distributed knowledge synchronized, to allow the spanning tree topology maintenance and avoid or remove undesirable loops in multi-hop paths. The results obtained through simulation show that WSTP ensures a lower distance between the nodes and the root when compared to an approach that performs associations based on the first contact, and therefore, it provides a lower resource consumption and lower delay in the communications.