August 20, 2020

Check HTTP Status codes in Google Sheets for URLs

Spread the love

Statuses and Codes:

Okay, this little hack has become a personal favorite for me and I had to share it. I had to clean up a sitemap with over 6000 URLs and I just happened to not have my Screamingfrog (God bless the frog) License with me. I remembered the good old script editor inside Google Sheets and decided t give it a try. So Here's how you get HTTP status codes in google sheets.

HTTP STATUS CODE in Google Sheets App Script:


Head to your Google Sheets and open up the script editor

wPVWDxur2rPXuFB6BRrPct4fZEEc8C 9 P30eHRqwHzOuAd79EGp0oSoGP YwxKUolAe5HMZy0pDTAMRpskw7fpbtQSJTpvKTgdf3sHjeboom4b
function getStatusCode(url){
   var options = {
     'muteHttpExceptions': true,
     'followRedirects': false
   };   var url_trimmed = url.trim();   var response = UrlFetchApp.fetch(url_trimmed, options);
   return response.getResponseCode();

Paste the above script into the script editor. 

Remember the function name "httpstatus" is going to be your new custom command to check status codes

Save and give the project a name and accept the permissions required for it to run.

Checking the Status Codes

And Now for the moment of truth:

Go back to the google sheet and place the URL/ Domain in any Cell

I choose to bulk check a lot of them so pasted an array of domains in A.

ynqTEjw0KJwglMZNveMku6IowKaHrnWBxLGNAY6LUt0P YWVBzxXoEjQktrHjGWqtR6t25 xv6J1ZFGIofEG3Tq1Tj Ryg5JPCIncsaAXSMnckvCIkuzglyjeuUq5bjcacOH 99j

Use the following Formula in B

and there you have it a quick and easy way to check HTTP status codes in Google Sheets. is the personal website of Daniel (Dan) Antony, a digital marketer passionate about business and technology
© Copyright 2020 - Built with Oxygen By Dan Antony
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram