google-indexing-script
google-indexing-script copied to clipboard
Script to get your site indexed on Google in less than 48 hours
trafficstars
Google Indexing Script
Use this script to get your entire site indexed on Google in less than 48 hours. No tricks, no hacks, just a simple script and a Google API.
You can read more about the motivation behind it and how it works in this blog post https://seogets.com/blog/google-indexing-script
[!IMPORTANT]
- Indexing != Ranking. This will not help your content/page rank on Google, it'll just let Google know about the existence of all your pages.
- This script uses Google Indexing API. While there is no absolute guarantee that every page will be indexed, recent tests conducted in December 2023 have shown a notably high success rate.
Requirements
- Install Node.js
- An account on Google Search Console with the verified sites you want to index
- An account on Google Cloud
Preparation
- Download or clone this repository
- Follow this guide from Google. By the end of it, you should have a project on Google Cloud with the Indexing API enabled, a service account with the
Ownerpermission on your sites. - Make sure you enable both
Google Search Console APIandWeb Search Indexing APIon your Google Project ➤ API Services ➤ Enabled API & Services. - Download the JSON file with the credentials of your service account and save it in the same folder as the script. The file should be named
service_account.json
Usage
- Open a terminal and navigate to the folder where you cloned the repository
- Ensure you are using an up-to-date Node.js version, with a preference for v20 or later. Check your current version with
node -v. - Run
npm installto install the dependencies - Run
npm run index <domain or url>to index all the pages of your site.
- If your site is a
DomainProperty on GSC, then run it likenpm run index seogets.com - Otherwise, if it's a
URL Prefixproperty, then run it likenpm run index https://seogets.com - When in doubt try both 😀
Here's an example of what you should expect:

Important Notes:
- Your site must have 1 or more sitemaps submitted to Google Search Console. Otherwise, the script will not be able to find the pages to index.
- You can run the script as many times as you want. It will only index the pages that are not already indexed.
- Sites with a large number of pages might take a while to index, be patient.
📄 License
MIT License
💖 Sponsor
This project is sponsored by SEO Gets
