SEO Learn an easy trick to bulk check if URLs are indexed in Google Sheets.

Babushka

Well-known member
VIP MEMBER
Joined
Jul 28, 2022
Messages
287
Google Sheets is a powerful tool for scraping various types of data. One way to use it is by running a script that checks whether a given URL has been indexed on Google by searching for 'site:domain.com'. The script relies on Google's own scraping capabilities, so there's no need to use proxies or other tools. This code can be adapted to scrape data from other sources, too. It works well for websites like Reddit and many others. To get started, open the Script Editor in Google Sheets.

1.png

Step #2: Paste the code into the script editor and save the file by using Ctrl+S. The code that needs to be copied and pasted is provided below.

function checkIfPageIsIndexed(url) { url = "https://www.google.com/search?q=site:"+url; var options = { 'muteHttpExceptions': true, 'followRedirects': false }; var response = UrlFetchApp.fetch(url, options); var html = response.getContentText(); if ( html.match(/Your search -.*- did not match any documents./) ) return "URL is Not Indexed"; return "URL is Indexed"; }

2.png

Step #3: Execute the Function in Google Sheets

3.png

Step #4: Use the Output

Bonus: Implement Conditional Formatting to Highlight Cells based on Indexing Status

4.png

The resulting output may resemble the following.
 
This tip is truly valuable, coming from an actual practitioner rather than someone merely speculating. Well done!
 
Although I don't frequently bookmark posts, this one is exceptional. Thank you for sharing such valuable content.
 
Google Sheets is a powerful tool for scraping various types of data. One way to use it is by running a script that checks whether a given URL has been indexed on Google by searching for 'site:domain.com'. The script relies on Google's own scraping capabilities, so there's no need to use proxies or other tools. This code can be adapted to scrape data from other sources, too. It works well for websites like Reddit and many others. To get started, open the Script Editor in Google Sheets.

View attachment 27932

Step #2: Paste the code into the script editor and save the file by using Ctrl+S. The code that needs to be copied and pasted is provided below.

function checkIfPageIsIndexed(url) { url = "https://www.google.com/search?q=site:"+url; var options = { 'muteHttpExceptions': true, 'followRedirects': false }; var response = UrlFetchApp.fetch(url, options); var html = response.getContentText(); if ( html.match(/Your search -.*- did not match any documents./) ) return "URL is Not Indexed"; return "URL is Indexed"; }

View attachment 27933

Step #3: Execute the Function in Google Sheets

View attachment 27934

Step #4: Use the Output

Bonus: Implement Conditional Formatting to Highlight Cells based on Indexing Status

View attachment 27935

The resulting output may resemble the following.
Are there any specific books or articles that you would like me to recommend based on your interests or the subject matter you're interested in?
 
Back
Top Bottom