How to Check If Your Website Has Broken Links: A Developer's Guide
Broken links are silent killers for websites. They frustrate users, hurt SEO rankings, and make your site look unprofessional. But here's the thing: most developers only discover broken links when users complain or when search rankings start dropping. By then, the damage is already done.
So how do you check if your website has broken links before they become a problem? This guide covers everything from quick manual checks to automated monitoring solutions that will keep your links healthy 24/7.
Why Checking for Broken Links Matters
Before we dive into the "how," let's quickly cover the "why." Broken links impact your website in several ways:
- SEO damage: Google sees broken links as a sign of poor site maintenance, which can hurt your search rankings
- Poor user experience: Nothing kills user trust like clicking a link that goes nowhere
- Wasted crawl budget: Search engines waste time crawling broken pages instead of your important content
- Lost conversions: Broken links in your sales funnel mean lost revenue
The good news? Finding and fixing broken links is one of the easiest wins in web development.
Method 1: Manual Spot Checking
For small websites or quick checks, manual verification can be effective. Start with your most important pages:
- Homepage: Check all navigation links and key CTAs
- Top landing pages: Verify links in your highest-traffic content
- Contact and about pages: Ensure all external links work
- Recent posts/updates: New content is most likely to have link issues
This method works for sites with under 50 pages, but it's time-consuming and error-prone for anything larger.
Method 2: Browser Extensions
Several browser extensions can help identify broken links as you browse:
Check My Links (Chrome)
This extension highlights broken links in red and working links in green. Just install it, visit any page, and click the extension icon. It's perfect for spot-checking individual pages during development.
LinkChecker (Firefox)
Firefox users can use LinkChecker, which provides similar functionality with detailed error reporting. It even checks for slow-loading links that might timeout.
Pros: Quick and visual, great for development Cons: Only checks one page at a time, requires manual effort
Method 3: Command Line Tools
For developers who prefer terminal-based solutions:
wget
wget --spider -r -nd -nv -H -l 1 -w 2 -o wget.log https://yoursite.com
This command crawls your site and logs any broken links to wget.log.
linkchecker (Python)
pip install linkchecker
linkchecker https://yoursite.com
Linkchecker provides detailed reports and can check both internal and external links.
Pros: Free, scriptable, detailed output Cons: Technical setup required, limited reporting features
Method 4: Online Link Checking Tools
Several web-based tools can scan your entire website for broken links:
W3C Link Checker
The W3C provides a free link checker that scans individual pages or entire sites. It's reliable but slow for large sites.
Broken Link Checker
This free tool checks up to 3,000 pages and provides a downloadable report. It's user-friendly but has limited customization options.
Pros: No installation required, user-friendly Cons: Often limited by page count, may miss complex JavaScript links
Method 5: Professional SEO Tools
For comprehensive link monitoring, professional tools offer the best features:
Screaming Frog SEO Spider
This desktop application crawls your entire website and identifies broken links, redirect chains, and other technical issues. The free version handles up to 500 URLs.
Ahrefs Site Audit
Ahrefs provides broken link detection as part of its comprehensive site audit. It's excellent for larger sites but requires a paid subscription.
SEMrush Site Audit
Similar to Ahrefs, SEMrush offers broken link checking alongside other SEO health metrics.
Pros: Comprehensive reporting, regular monitoring, detailed insights Cons: Can be expensive for small sites
Method 6: Automated Monitoring Solutions
The best approach is automated monitoring that alerts you to broken links as they appear:
Setting Up Automated Checks
Most professional tools offer scheduled scans that run weekly or monthly. Set up alerts to notify you immediately when new broken links are detected.
Custom Scripts
For developers, creating a custom monitoring script using tools like Puppeteer or Selenium can provide tailored solutions:
const puppeteer = require('puppeteer');
async function checkLinks(urls) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
for (const url of urls) {
const response = await page.goto(url);
if (response.status() >= 400) {
console.log(`Broken link: ${url} - Status: ${response.status()}`);
}
}
await browser.close();
}
Best Practices for Link Checking
1. Check Regularly
Don't wait for problems to surface. Schedule regular link checks:
- Weekly: For frequently updated sites
- Monthly: For stable sites
- After updates: Always check links after content updates or site changes
2. Prioritize Internal Links
While external links break due to factors outside your control, internal broken links are entirely your responsibility. Fix these first.
3. Check Different Link Types
Don't forget about:
- Image links (broken images hurt user experience)
- Download links (PDFs, documents, files)
- Anchor links (jumping to sections within pages)
- JavaScript-generated links
4. Monitor External Links
While you can't control external sites, you can monitor when they break and either fix or remove the links. Some tools can even suggest alternative sources.
5. Set Up 301 Redirects
When you find broken internal links, don't just delete them. If the content moved, set up proper redirects to preserve SEO value and user experience.
Common Causes of Broken Links
Understanding why links break helps prevent future issues:
- URL structure changes: Modifying permalinks without redirects
- Content deletion: Removing pages without updating referring links
- Server moves: Changing domains or hosting without proper redirects
- External site changes: Third-party sites going offline or changing URLs
- Typos: Simple misspellings in URLs during content creation
Fixing vs. Preventing
While finding broken links is important, preventing them is even better:
- Use relative URLs for internal links when possible
- Implement proper 301 redirects when moving content
- Regularly audit content before deletion
- Use link shorteners for frequently changing external URLs
- Set up monitoring to catch issues early
How Often Should You Check?
The frequency depends on your site:
- High-traffic, frequently updated sites: Weekly checks
- Business websites with regular updates: Monthly checks
- Static sites or portfolios: Quarterly checks
- E-commerce sites: Weekly (broken product links = lost sales)
Quick Checklist: How to Check If Your Website Has Broken Links
- Choose your tool: Browser extension for quick checks, professional tool for comprehensive audits
- Start with critical pages: Homepage, top landing pages, contact information
- Scan your entire site: Use automated tools for full coverage
- Check all link types: Internal, external, images, downloads
- Fix immediately: Don't let broken links linger
- Set up monitoring: Automate future checks to catch problems early
- Document the process: Keep track of common issues and solutions
Conclusion
Learning how to check if your website has broken links is an essential skill for any developer or website owner. Whether you choose manual checking for small sites or automated monitoring for larger projects, the key is consistency. Regular link audits prevent small issues from becoming major problems.
Remember: a website with working links isn't just better for SEO—it's better for your users. Every broken link is a missed opportunity to guide visitors toward your goals, whether that's making a purchase, signing up for a newsletter, or simply finding the information they need.
Don't let broken links silently damage your website's performance. Start checking today, fix what's broken, and put monitoring in place to keep your links healthy going forward.
Start Checking Your Links Today
Ready to see how healthy your website's links really are? Leo Scanner provides comprehensive broken link detection along with SEO audits, security checks, and performance analysis—all in one quick scan.
Try Leo Scanner for free → and get a complete report of your website's link health in under 30 seconds. No signup required.
Check your website for free
Leo Scanner checks your site for broken links, SEO issues, security problems, and more — in 30 seconds.
Scan your website →