The protection of intellectual property (IP) rights, given international legal effect through the World Trade Organization (WTO) Trade-Related Aspects of IP Rights (TRIPS) Agreement, has long been a contentious issue. In recent years, the long-standing debate on IP rights as a barrier to the access of affordable medicines has been heightened by the global vaccine inequity evidenced during the COVID-19 pandemic. The TRIPS Agreement contains a number of flexibilities that WTO members can exploit in order to accommodate their policy needs. Among these is the mechanism of compulsory licensing, whereby patent licenses may be granted without consent of the patent holder in certain circumstances. TRIPS Article 31bis created a special mechanism for compulsory licenses specifically for the export of pharmaceutical products to countries with insufficient manufacturing capacity. We analyzed domestic patent legislation for 195 countries (193 UN members and two observers) and three customs territories. We analyzed patent legislation for provisions on compulsory licenses, including those defined in Article 31bis of the TRIPS Agreement. We identified 11 countries with no patent legislation. Of the 187 countries with domestic or regional patent laws, 176 (94.1%) had provisions on compulsory licensing and 72 (38.5%) had provisions implementing TRIPS Article 31bis. The results of this study have highlighted the gap in the implementation of TRIPS flexibilities in countries' national patent legislation, especially in least-developed countries. Although it will not fully solve patent barriers to the access of medicines, implementation of compulsory licensing (and specifically those for the import and export of pharmaceutical products) will provide governments with another tool to safeguard their population's public health. Further discussions are needed to determine whether the WTO can provide effective responses to future pandemics or global crises.