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
Code language: Bash (bash)
Option | Description |
--limit=<count> | The maximum number of URLs to validate for each template and content type. |
--include=<templates> | Only validates a URL if one of the conditionals is true. For example, --include=is_tag,is_category |
--force | 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
Code language: Bash (bash)
For large sites, validation will take a long time without using the --limit
option.
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
Code language: Bash (bash)
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
Code language: Bash (bash)
Passing the --yes
flag ensures that this doesn’t confirm ‘Are you sure you want to empty…’
$ wp amp validation reset --yes
Code language: Bash (bash)