Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/mamemaki/submit-sitemap

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/mamemaki/submit-sitemap

  • v1.0.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

submit-sitemap

submit-sitemap is a command line tool to submit a sitemap to search engines (Google/Bing).

Install

Download the executable from Github releases

Download the executable from Github releases according to your platform.

Ubuntu(PowerShell):

wget https://github.com/mamemaki/submit-sitemap/releases/download/v1.0.0/submit-sitemap_Windows_x86_64.zip -outfile $pwd\submit-sitemap.zip
Expand-Archive submit-sitemap.zip
.\submit-sitemap\submit-sitemap.exe -v

Ubuntu:

wget https://github.com/mamemaki/submit-sitemap/releases/download/v1.0.0/submit-sitemap_Linux_arm64.tar.gz
tar -xvzf submit-sitemap_Linux_arm64.tar.gz
./submit-sitemap -v

From source with Go environment

go install github.com/mamemaki/submit-sitemap@v1

or

go run github.com/mamemaki/submit-sitemap@v1 -f=https://example.com/sitemap.xml -t=google

Usage

To submit a sitemap to Google:

submit-sitemap -f=https://example.com/sitemap.xml -t=google

To submit a sitemap to Google and Bing:

submit-sitemap -f=https://example.com/sitemap.xml -t=google,bing

Command Line Options

The following are submit-sitemap's command-line options:

Usage:
  submit-sitemap [flags]

Flags:
  -f, --feedurl string           The sitemap URL to submit. e.g. https://example.com/sitemap.xml
  -t, --target strings           The target search engines(google/bing) (default [])
      --dry-run                  Output the operations but do not execute anything
      --verbose                  Enable verbose output mode
      --google-siteurl string    The URL of the property as defined in Search Console. For example: https://example.com/ (URL-prefix property), or sc-domain:example.com (Domain property). If omitted, we will guess it from feedurl. If your site in Google Search Console is Domain property, you have to use this option explicitly.
      --google-feedpath string   FeedUrl for Google. If omitted, we will guess it from feedurl. e.g. https://example.com/sitemap.xml
      --bing-siteurl string      Site URL for Bing. If omitted, we will guess it from feedurl. e.g. http://example.com
      --bing-feedpath string     FeedUrl for Bing. If omitted, we will guess it from feedurl. e.g. https://example.com/sitemap.xml
  -h, --help                     help for submit-sitemap
  -v, --version                  version for submit-sitemap

Google

We use the Google Search Console API to submit a sitemap to the site property(URL-prefix or Domain).

Prerequirements

  • Your Site property(either URL prefix or domain) on Google Search Console
  • GCP Project to be used for sitemap submission

Authentication

We use Service Account authentication. other authentication method is not supported.

To authenticate your Service Account when submit a sitemap, set the contents of the credential JSON to the environment variable(GOOGLE_APPLICATION_CREDENTIALS_JSON).

How to create a Service Account on your GCP project

  1. Open Service account in your GCP project
  2. Create a Service account and save the credential JSON file
    All default. no roles, no permissions.

How to enable "Search Console API" on your GCP project

  1. Open Search Console API in your GCP project
  2. Click "Enable" button
  1. Open Users and privileges in Google Search Console
  2. Add your Service Account email as a user with "full" privileges.

If your site is a Domain property

If your site on Google Search Console is Domain property, you have to use the --google-siteurl option explicitly as shown below.

To submit a sitemap to Google that uses Domain property:

submit-sitemap -f=https://example.com/sitemap.xml -t=google --google-siteurl=sc-domain:example.com

Bing

We use the Bing Webmaster API to submit a sitemap to the site on Bing.

To authenticate, set the API Key to the environment variable(BING_APIKEY).

How to generate API Key

Please refer to Getting Access to the Bing Webmaster Tools API.

FAQ

Why not use sitemap ping?

Google and Bing have stopped supporting sitemap ping due to spam issues(ref, ref2). Therefore, if we want to submit a sitemap, we must use an authenticated API.

Why not use Indexing API or IndexNow? what is the difference between them?

Indexing API and IndexNow are per-URL index request APIs. These APIs and sitemap submissions have different purposes as follows.

Request unitIndexing speedPurpose
Indexing API and IndexNowURLin few minsRequest indexing of specific URLs as soon as possible
Submit a sitemapSitemapin few daysLet search engines know that the site has been updated

Contributing Guidelines

Contributions are welcome via pull requests. Please see here for more information.

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc