Book a free SEO check - Let's check your SEO together

How to Immediately Find Broken Links from Google’s Index (for Free)

Kirjoittanut Tapio Kauranen

Kirjoitettu: 21.7.2026 - Muokattu: 22.7.2026

Sisällysluettelo

Find broken links using Google Sheets

A free, fast and easy way to find broken links from Google’s Index.

During a website redesign, the site structure typically changes. In such cases, you need to create redirects from the old URLs to the new ones.

Otherwise, links in Google’s Index will lead to a “404 – Page not found” page.

This information is visible in Google Search Console, but data in Search Console updates with a delay of several days.

In this guide, I will show you how to create the script below, which checks the links in just a few seconds.

1. Get a list of URLs

Get a list of all your site’s URLs into Google Docs
  1. Log in to Google Search Console
  2. Go to the Performance section
  3. Select Pages
  4. Select Export
  5. Select Export to Google Sheets

2. Create Apps Script

The URL address verification feature is not available in Google Sheets by default, so we’ll create one

Click “Extensions” at the top of the site and go to the “Apps Script” section

3. Copy the code below

The URL address verification feature is not available in Google Sheets by default, so we’ll create one
  1. Give your script a name. For example HTTP Response code checked 404
  2. Delete the default code and copy the code snippet below in its place


function HTTPResponse( uri )
{
var response_code ;
try {
response_code = UrlFetchApp .fetch( uri ) .getResponseCode() .toString() ;
}
catch( error ) {
response_code = error .toString() .match( / returned code (\d\d\d)\./ )[1] ;
}
finally {
return response_code ;
}
}

4. Save and Run

You need to give the code permission to run
  1. Press the diskette icon (save button)
  2. And then press Run
  3. Give the script full permissions to edit your Google Sheets file

5. Ready – Add the command to the spreadsheet

The =httpresponse() command is now active

You can now use a new command called =httpresponse in this spreadsheet.

It allows Google Sheets to fetch the status of a URL address

What do the codes mean?

  • 404 = page not found
  • 200 = page is found and everything is fine
  • See all status codes from Wikipedia