Echo/Docs

CLI command

seo crawl canonicals, hreflang and images

The canonical, hreflang and image checks of a stored site crawl.

Invocation#

Shell
echo-cli seo crawl canonicals --crawl <crawl-id> | hreflang --crawl <crawl-id> | images --crawl <crawl-id> --max-bytes <n> [--legacy-types <image/type,image/type>]

Inputs and output#

canonicals writes crawl, pages, missing (every HTML page answering 2xx without a canonical), cross_origin (url, canonical: canonicals naming another origin), unhealthy_target (url, canonical, status, error: canonicals naming a crawled page that errors, fails or redirects), chained (url, canonical, then: canonicals naming a page whose own canonical differs) and shared_titles (title, pages: a title several pages carry while naming different canonicals), as Google documents canonicals. hreflang writes crawl, pages, invalid (url, hreflang, reason: a value that is not a BCP 47 language tag, or names a region Intl.DisplayNames does not know; x-default is valid), missing_self (pages with alternates that do not list themselves), missing_default (pages with alternates naming no x-default page) and no_return (url, alternate, hreflang: a crawled alternate that does not list the page back), as Google documents hreflang. images writes crawl, images (how many distinct images the pages load), max_bytes, legacy_types (the content types --legacy-types named, in lower case; empty without it), findings — each image that, asked with HEAD now, does not answer 2xx, does not declare an image/ content type, is served in a content type --legacy-types names ("is served as <type>, a format declared legacy"), declares no Content-Length, or declares more than --max-bytes, with url, head (status, type, bytes, or error), problems and pages, the pages loading it — and without_alt (page, images: the images a page loads through an <img> with no alt attribute; an empty alt marks a decorative image and is not reported).

State effect#

The commands call Echo Web's authenticated /api/seo/crawls/<id> with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Crawl checks section of the GEO screen and of Echo Desktop's GEO screen read the same reports (with the legacy formats typed, if any), and echo-mcp runs them as echo_site_crawl_canonicals, echo_site_crawl_hreflang and echo_site_crawl_images. canonicals and hreflang read only the pages seo crawl run stored; images asks each image for its headers now, without following a redirect, and stores nothing. No format is legacy unless --legacy-types names it: a served type is compared with each named type without its parameters and case, so image/gif; charset=binary is image/gif.

Refusals#

  • A wrong invocation is refused before anything is sent: "seo crawl <verb> does not take <flag>; it takes <flags>", "<flag> needs a value" and "seo crawl <verb> needs <flag>", --max-bytes included.
  • Echo Web answers a bad request with "max_bytes is required: the largest image, in bytes, a page should load; got <value>" or "legacy_types, when given, must be image content types separated by commas, such as image/gif; got <value>" and not found with "no crawl has id <id>; echo-cli seo crawl list lists them". The command prints Echo Web's sentence and exits 1.