Giter VIP home page Giter VIP logo

google-indexing-script's Introduction

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

  1. Indexing != Ranking. This will not help your page rank on Google, it'll just let Google know about the existence of your pages.
  2. This script uses Google Indexing API. We do not recommend using this script on spam/low-quality content.

Requirements

Preparation

  1. 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 Owner permission on your sites.
  2. Make sure you enable both Google Search Console API and Web Search Indexing API on your Google Project โžค API Services โžค Enabled API & Services.
  3. 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

Installation

Using CLI

Install the cli globally on your machine.

npm i -g google-indexing-script

Using the repository

Clone the repository to your machine.

git clone https://github.com/goenning/google-indexing-script.git
cd google-indexing-script

Install and build the project.

npm install
npm run build
npm i -g .

Note

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.

Usage

With service_account.json (recommended)

Create a .gis directory in your home folder and move the service_account.json file there.

mkdir ~/.gis
mv service_account.json ~/.gis

Run the script with the domain or url you want to index.

gis <domain or url>
# example
gis seogets.com

Here are some other ways to run the script:

# custom path to service_account.json
gis seogets.com --path /path/to/service_account.json
# long version command
google-indexing-script seogets.com
# cloned repository
npm run index seogets.com
With environment variables

Open service_account.json and copy the client_email and private_key values.

Run the script with the domain or url you want to index.

GIS_CLIENT_EMAIL=your-client-email GIS_PRIVATE_KEY=your-private-key gis seogets.com
With arguments (not recommended)

Open service_account.json and copy the client_email and private_key values.

Once you have the values, run the script with the domain or url you want to index, the client email and the private key.

gis seogets.com --client-email your-client-email --private-key your-private-key
As a npm module

You can also use the script as a npm module in your own project.

npm i google-indexing-script
import { index } from 'google-indexing-script'
import serviceAccount from './service_account.json'

index('seogets.com', {
  client_email: serviceAccount.client_email,
  private_key: serviceAccount.private_key
})
  .then(console.log)
  .catch(console.error)

Read the API documentation for more details.

Here's an example of what you should expect:

Important

  • 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

google-indexing-script's People

Contributors

antoinekm avatar goenning avatar github-actions[bot] avatar ruthvik-17 avatar anjum48 avatar lucarestagno avatar dev-coco avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.