User Guide to Workflow Automation 👨🔧#
If you already use GitHub Actions to automate workflows in your website projects, you can also use it to automate the process of submitting your sitemap to the IndexNow API.
This is particularly useful if you have a large number of pages on your site that you want to submit all at once so search engines know when to crawl your site for faster indexing by Bing, Yandex, DuckDuckGo and other search engines.
How to Automatically Submit a Sitemap to IndexNow#
Regardless of whether your codebase is highly or less active, it is recommended that you do not submit your sitemap to IndexNow each time your site is deployed to production. This could overwhelm IndexNow and reduce the website's ranking.
Instead, you should automate sitemap submissions to IndexNow using GitHub Actions at regular intervals, allowing the changes to accumulate over time and allowing the search engines crawlers time to index the latest content.
Example workflow with GitHub Actions:
| .github/workflows/submit_sitemap_to_index_now.yml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Want to know more about the parameters? Learn how to customise your workflow parameters.
Checklist
Before running the workflow, make sure you have done the following:
- Added the API key
INDEX_NOW_API_KEYas a secret to your repository. - Uploaded the API key to the location specified in the
api_key_locationparameter. - Updated the URL of the sitemap in the
sitemap_locationparameter. - Adjusted the
host,endpoint, and other parameters to suit your needs.
Nested Sitemaps#
If you have a sitemap index that links to other sitemaps, you only need to submit that in the sitemap_locations parameter. Both the index and the nested sitemaps will be included in the submission to the IndexNow API.
Example#
If you have a sitemap index that links to two other sitemaps, for example, URLs from all three sitemaps will be included in the submission to the IndexNow API.
| sitemap_index.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 | |
In this case, you only need to submit a single sitemap with a link to sitemap_index.xml as the location.
Info
Only sitemaps on levels 1 and 2 are supported. Nested sitemaps on level 3 and beyond will be ignored.