NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Broken External Links on Stack Overflow

Jiakun Liu, Xin Xia, David Lo, Haoxiang Zhang, Ying Zou, Ahmed E. Hassan, Shanping Li · DOI

Abstract

Stack Overflow hosts valuable programming-related knowledge with 11,926,354 links that reference to third-party websites. These external resources extend the Stack Overflow knowledge base substantially. However, with the rapid development of programming-related knowledge, many resources hosted on the Internet are no longer available. Based on an analysis of Stack Overflow data released in June 2019, 14.2% of the links on the platform are broken. These broken links obstruct viewers from obtaining desired knowledge and potentially damage the reputation of Stack Overflow as posts may appear obsolete. This paper characterizes broken links on Stack Overflow, finding that 65% of broken links in sampled questions are used for examples (e.g., code snippets), and 70% in sampled answers provide supporting information. Despite the prevalence of link rot, only 1.67% of posts with broken links are flagged by viewers in comments, and only 5.8% of such posts have the broken links removed. We find that websites allowing user-maintained resources, like GitHub, are most frequently referenced by broken links. Furthermore, posts related to web technologies (JavaScript, HTML, CSS, jQuery) are associated with higher rates of link rot.

Introduction

Stack Overflow (SO) relies heavily on external links to supplement its crowdsourced knowledge base with documentation, live demos, and code repositories. However, the web is ephemeral. When these external resources disappear, the SO posts referencing them become "incomplete" or even useless. This paper presents a large-scale empirical study of "link rot" on Stack Overflow, revealing that 14.2% of all external links in the community's history are now broken. These dead links significantly hinder knowledge sharing, as they often point to the very code examples and documentation needed to solve a problem, ultimately leading to lower community engagement and "reputation decay" for older posts.

Methodology

The researchers employed a multi-step pipeline to analyze the health of Stack Overflow's external ecosystem:

  1. Extraction: They used the SOTorrent dataset (based on the June 2019 SO data dump) to extract over 12.4 million distinct external links from posts and comments.
  2. Availability Testing: To account for transient network issues, they performed two separate rounds of HTTP status checks using a distributed crawler (Scrapy). A link was only marked "broken" if it failed to return a 2xx success code in both trials.
  3. Manual Qualitative Analysis: The team manually labeled a statistically representative sample of 1,152 broken links to categorize their "intended roles" (e.g., Working Example, Supporting Information).
  4. Statistical Modeling: They used Mann-Whitney tests and Cliff’s delta to compare the vote scores of posts with and without broken links to measure community impact.

A critical finding is the "Working Example" trap. In questions, 65% of broken links were intended to provide live demos or code examples. When these break, the question often becomes impossible to answer or even understand. In answers, 70% of broken links provide supporting information, such as explaining a concept or a step in a solution.

Intended roles of external links across different post types.

Link rot is not a steady process. A significant spike in broken links occurred in May 2017, as shown in the temporal analysis. This was traced back to an automated SO bot that bulk-converted HTTP links to HTTPS for security. While well-intentioned, many older servers didn't support HTTPS, effectively "breaking" thousands of valid links overnight.

Temporal trends of broken links on Stack Overflow, highlighting the 2017 spike.

Key Findings

  • Prevalence: 14.2% (1,687,995) of external links are broken. The 404 (Not Found) error is the most frequent (50.7%).
  • GitHub Paradox: While GitHub is the gold standard for sharing code, it is also a major source of link rot. 7.33% of all broken links on SO point to GitHub, often due to deleted repositories or changed account names.
  • Invisible Decay: Only 1.67% of posts with broken links are ever flagged by users in the comments. This suggests that link rot is a "silent killer" of content quality that the community is not actively policing.
  • Tag Sensitivity: Web technology tags like JavaScript, PHP, and HTML are associated with the highest number of broken links, likely due to the fast-paced nature of web frameworks and the frequent use of ephemeral "playground" sites.

Conclusion and Future Work

The study highlights that only 5.8% of posts with broken links ever had the link removed or repaired. To combat this, the authors suggest that Stack Overflow should implement automated broken link detection and consider archiving snapshots (via services like the Wayback Machine) the moment a link is posted to ensure the knowledge remains permanent. They also urge users to prioritize using built-in Code Blocks and Stack Snippets over external hosting.

Summary updated

BibTeX
@article{liu2020broken,
  author = {Jiakun Liu and Xin Xia and David Lo and Haoxiang Zhang and Ying Zou and Ahmed E. Hassan and Shanping Li},
  title = {{Broken External Links on Stack Overflow}},
  journal = {IEEE Trans. Software Eng.},
  year = {2020},
  doi = {10.1109/tse.2021.3086494},
}
Figure