Aims. To apply a theoretical approach to the study of marketing and the library context, taking into consideration the technological transformations of the social media and social web applications, and implementing guidelines for the design of a web 2.0 marketing plan for libraries. Methodology. To analyse the literature and the practices observed in libraries regarding online marketing policies and plans, case studies on the use of the main social networks (Facebook, Twitter and Tuenti, in Spain), and the presentation of the most recent marketing trends, in order to use them as references in the implementation of a web 2.0 marketing plan for libraries. Results. Libraries should promote library services and consider marketing as a regular part of their daily activities. This is particularly true in our interconnected world where the use of social web and social media tools are continuously gaining ground, and where libraries are seeking a presence in social networks to promote their contents and facilitate contact with users. Libraries must be able to control their web impact and measure their presence and brand image in the digital environment. Online marketing is vital for the success and continuity of library services; it can help libraries to foresee future challenges and enable them to deal proactively with future user needs. Therefore, as part of their strategic planning, libraries should include the design of a specific online marketing plan that is well suited to their characteristics.