How to auto-fill & auto-submit Google Search Console sitemap using Tapermonkey
When using Google Search Console, you might want to submit your sitemap manually from time to time to accelerate indexing of new content on your website.
The following Tapermonkey script will automatically fill in sitemap.xml
and click the Send
button. Depending on your language setting, you will need to adjust the document.querySelector()
calls and modify the script header according to your domain (mydomain.com
in this example):
// ==UserScript==
// @name SearchConsoleAutoFillSitemap
// @namespace http://tampermonkey.net/
// @version 0.1
// @description ?
// @author You
// @match https://search.google.com/search-console/sitemaps?resource_id=https%3A%2F%2Fmydomain.com%2F&hl=de
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Simulate input
let elem = document.querySelector("input[aria-label='Sitemap-URL eingeben']");
elem.value = "sitemap.xml";
elem.dispatchEvent(new Event('input', {
bubbles: true,
cancelable: true,
}));
// Click "Send" button
setTimeout(() => {
console.log("Clicking Send button");
document.querySelector("c-wiz[data-node-index='2;0'] div[tabindex='0']").click();
}, 500);
})();