This is a known issue. We were blocked on an upstream AMP spec update, which I can see now has been done. You can follow https://github.com/ampproject/amp-wp/issues/7601 for updates.
Thanks for the tip.
What should I do to fix this error?
You can just ignore it.
Otherwise, you can suppress it from being reported in the first place using the amp_validation_error_sanitized filter (docs). For example:
add_filter(
'amp_validation_error_sanitized',
static function ( $sanitized, $error ) {
if (
'DISALLOWED_ATTR' === $error['code'] &&
'fetchpriority' === $error['node_name']
) {
$sanitized = true;
}
return $sanitized;
},
10,
2
);
This can go in a custom plugin or your theme’s functions.php.
Thank you so much. If you suggest that we ignore this error, I prefer to listen to you
This error does not affect the index of our pages in Google?
Because we have installed “AMP” to increase the attention of Google
The AMP plugin identifies the error but it still sanitizes the markup to be valid AMP. So it doesn’t impact AMP validity. It’s more for your information to let you know it is removing something from your markup which you may have wanted.