Hi,
I have same problem, the followings are the validation status from Google official AMP Validator.
1. The attribute ‘prefix’ may not appear in tag ‘html ⚡ for top-level html’.
2. The mandatory tag ‘html ⚡ for top-level html’ is missing or incorrect.
After disabling All in One SEO plugin, the error messages are gone.
Please help me to resolve this issue, thanks a lots.
Hi Li-An,
I found the default enabled option “Use Schema.org Markup” caused this issue.
Disabling it can resolve this, but I don’t know why.
I think we need developer to tell us why and he might fix it soon.
We are aware of this and are removing that code in a release due out soon. For now, you can just use the option for Use Schema.org Markup to remove this.
-
This reply was modified 7 years, 6 months ago by Steve M.
2.3.10.1 has been released which should fix this issue.
Thread Starter
Li-An
(@li-an)
I’ve got still an error: The attribute ‘prefix’ may not appear in tag ‘html ⚡ for top-level html’.
That prefix declares that the page is a rich object in a social graph. It’s required for the Open Graph Protocol (http://ogp.me/) and is supported by Facebook (https://developers.facebook.com/docs/reference/opengraph/object-type/website/) and Google (https://developers.google.com/web/fundamentals/discovery-and-monetization/social-discovery/).
I’ve opened an issue (https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/577) to look into removing this but we’ll need to be careful in case this has an impact on Open Graph social sharing which is a major feature of our plugin.
In the meantime, here’s some code you can add to the functions.php file in your active theme that will remove the prefix on AMP pages:
add_action( 'pre_get_posts', 'aio_amp_remove_my_ogp' );
function aio_amp_remove_my_ogp(){
$aio_queries = get_query_var( 'amp' );
if(!empty($aio_queries) && $aio_queries === 1){
add_filter( 'aiosp_opengraph_attributes', 'aio_remove_my_att' );
}
}
function aio_remove_my_att( $att ){
$att = array();
return $att;
}
-
This reply was modified 7 years, 6 months ago by Steve M.
Thread Starter
Li-An
(@li-an)
Thanks for quick answer. In fact, I have two errors:
The attribute ‘prefix’ may not appear in tag ‘html ⚡ for top-level html’.
The mandatory tag ‘html ⚡ for top-level html’ is missing or incorrect.
Experiencing the same errors here. Google Webmaster Tools shows the error for a second then clears but still going against my error stats and most likely publish status. Please update us if you can.
Thread Starter
Li-An
(@li-an)
@dnorenberg: as it says, the problem is solved for me with last version of AMP and All in One SEO versions. So you have to search for another problem – clear cache plugin?