Table: googlesearchconsole_sitemap - Query Search Console sitemap submissions with SQL
Search Console sitemaps are XML files that list the URLs of a site, allowing webmasters to inform search engines about the pages on their site that are available for crawling. Sitemaps help search engines discover and index pages more efficiently.
Table Usage Guide
This googlesearchconsole_sitemap
table is instrumental for webmasters and SEO professionals to analyze the sitemaps they have submitted to Google Search Console. It helps in monitoring the health and status of these sitemaps, identifying submission errors, and understanding the scope of URLs covered.
Examples
Basic search console sitemap info
Retrieve basic information about all submitted sitemaps, including the site URL, sitemap path, type, and total number of URLs submitted within each sitemap. This query is ideal for getting an overview of sitemap submissions.
select site_url, path, type, c ->> 'submitted' as total_urlsfrom googlesearchconsole_sitemap, jsonb_array_elements(contents) as c;
select site_url, path, type, json_extract(content.value, '$.submitted') as total_urlsfrom googlesearchconsole_sitemap, json_each(contents) as content;
List sitemaps for a specific site
Filter the sitemaps for a particular site, providing focused insights on the sitemap submissions for that site. This can be useful for site-specific audits and optimization efforts.
select site_url, path, type, c ->> 'submitted' as total_urlsfrom googlesearchconsole_sitemap, jsonb_array_elements(contents) as cwhere site_url = 'https://www.example.com/';
select site_url, path, type, json_extract(content.value, '$.submitted') as total_urlsfrom googlesearchconsole_sitemap, json_each(contents) as contentwhere site_url = 'https://www.example.com/';
List sitemaps for a specific domain
View the sitemap submissions for a domain-level property in Google Search Console. This query is particularly useful for managing sitemaps across an entire domain, including all subdomains and protocols.
select site_url, path, type, c ->> 'submitted' as total_urlsfrom googlesearchconsole_sitemap, jsonb_array_elements(contents) as cwhere site_url = 'sc-domain:example.com';
select site_url, path, type, json_extract(content.value, '$.submitted') as total_urlsfrom googlesearchconsole_sitemap, json_each(contents) as contentwhere site_url = 'sc-domain:example.com';
List sitemaps with errors
List all sitemaps that have errors, including the total number of URLs submitted and the count of errors. This query helps in identifying sitemaps that need attention and potentially re-submission after correcting the errors.
select site_url, path, is_pending, c ->> 'submitted' as total_urls, errors as error_countfrom googlesearchconsole_sitemap, jsonb_array_elements(contents) as cwhere errors > 0;
select site_url, path, is_pending, json_extract(content.value, '$.submitted') as total_urls, errors as error_countfrom googlesearchconsole_sitemap, json_each(contents) as contentwhere errors > 0;
List index sitemaps
Identify all index sitemaps, which are sitemaps that contain other sitemaps. This is useful for large sites that need to organize their URLs into multiple sitemaps for efficient management.
select site_url, pathfrom googlesearchconsole_sitemapwhere is_sitemaps_index;
select site_url, pathfrom googlesearchconsole_sitemapwhere is_sitemaps_index = 1;
Schema for googlesearchconsole_sitemap
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
contents | jsonb | The various content types in the sitemap. | |
errors | bigint | Number of errors in the sitemap. | |
is_pending | boolean | If true, the sitemap has not been processed. | |
is_sitemaps_index | boolean | If true, the sitemap is a collection of sitemaps. | |
last_downloaded | timestamp with time zone | Date & time in which this sitemap was last downloaded. | |
last_submitted | timestamp with time zone | Date & time in which this sitemap was last submitted. | |
path | text | The url of the sitemap. | |
project | text | =, !=, ~~, ~~*, !~~, !~~* | The GCP Project associated with the credentials in use. |
site_url | text | = | The URL of the site. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
type | text | The type of the sitemap. | |
warnings | bigint | Number of warnings in the sitemap. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- googlesearchconsole
You can pass the configuration to the command with the --config
argument:
steampipe_export_googlesearchconsole --config '<your_config>' googlesearchconsole_sitemap