Validating The Site #
This WP-CLI command crawls the entire site for validation, or as much of it as you’d like.
$ wp amp validation run
|The maximum number of URLs to validate for each template and content type.|
|Only validates a URL if one of the conditionals is true. For example, |
|Force validation of URLs even if their associated templates or object types do not have AMP enabled.|
For example, if you want to limit this to 10 URLs for each type and only include tag and category templates:
$ wp amp validation run --limit=10 --include=is_tag,is_category
For large sites, validation will take a long time without using the
If you’re in Transitional mode (formerly ‘Paired’) and those templates are disabled, it won’t be possible to validate them without a flag.
For example, the “Categories” and “Tags” templates are disabled here in the “AMP Settings” menu:
To force validating these templates, add the
--force flag to the command:
$ wp amp validation run --limit=10 --include=is_tag,is_category --force
You’ll see a link at the bottom that shows all of the validated URLs.
Resetting Site Validation #
If there was a change in the site, like if a plugin or theme was activated, you can reset the validation status of your site via a WP CLI command:
$ wp amp validation reset
--yes flag ensures that this doesn’t confirm ‘Are you sure you want to empty…’
$ wp amp validation reset --yes