Tapio Kauranen

Find broken links in Google’s Index instantly (for free)

Table of contents: Introduction

1. Get a list of URLs

Fetch a list of all your site’s URLs into a Google Doc

  1. Sign in to Google Search Console
  2. Go to the Performance section
  3. Select Pages
  4. Click Export
  5. Choose Export to Google Sheets
Search Console's performance report: steps 1–3 point to the Performance menu, the Pages tab and the Export button

2. Create an Apps Script

Google Sheets doesn’t include a built-in URL-checking feature, so we’ll create one

From the site menu, click "Extensions" and open "Apps Script"

Apps Script chosen from the Extensions menu in Google Sheets, with a page list exported from Search Console behind it

3. Copy the code below

Google Sheets doesn’t include a URL-checking feature out of the box, so we’ll create one

  1. Give your script a name. For example HTTP Response code checked 404
  2. Remove the boilerplate code and replace it with the snippet below
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 ;
}
}
The Apps Script editor: a new untitled project with an empty myFunction function in its Koodi.gs (Code.gs) file

4. Save and run

You’ll need to authorize the script to run

  1. Click the floppy disk icon (save button)
  2. Then click Run
  3. Grant the script full permission to edit your Google Sheets file

Apps Script's notice “Edellyttää valtuutusta” (authorization required) with the button “Tarkista käyttöoikeudet” (review permissions)

The Apps Script editor with the HTTPResponse function: number 1 points at the Save button and number 2 at the Suorita (Run) button

5. Ready — add the command to the sheet

The =httpresponse() function is now active

You can now use a new function in this sheet called =httpresponse.

It lets Google Sheets fetch the status for a given URL.

What do the codes mean?

  • 404 = page not found
  • 200 = page found and everything is OK
  • See the full list of status codes on Wikipedia
The =httpresponse formula in Google Sheets checks the page list from Search Console: one address returns 404, the others 200

Need help?

Book a free SEO check: in a 60-minute video call we look at how your website shows up on Google in Finland and what to fix first.

Email

tapio@tapiokauranen.com

Tell me briefly what you need. I will reply as soon as I can.

Free SEO check

A 60-minute Google Meet call: we look at how your website shows up on Google in Finland.

Book a free SEO check