Naibabiji has installed the AMP plugin recommended by Google. Today, we received a notification from Google stating there are errors in the AMP URLs, one of which is „
Required Structured Data Elements are Incorrect”

Method to resolve „Required Structured Data Elements are Incorrect“
The solution is simple. Use the Google Structured Data Testing Tool, paste the source code of the page with the error, and check it to identify the problem. Google Structured Data Testing Tool address:
https://search.google.com/structured-data/testing-toolRequired Structured Data Elements Error One: logo
The error encountered by Naibabiji was the missing logo address, as shown in the image below.

Once the problem is identified, it's easy to solve. Go to the WordPress Admin Dashboard, select Appearance > Customize. In the Site Identity section, upload a site icon, then test again, and the problem will be resolved.

Required Structured Data Elements Error Two: image
If you also encounter an image error, it is because you have not uploaded a featured image. There are three solutions: 1. Manually add a featured image to the Post. 2. Use a random featured image plugin to batch add featured images to Posts.
WordPress Random Featured Image Plugin: Random Post Thumbnails3. Use code to set a default featured image for AMP pages. The code is as follows (Naiba has not tested it):
//修正 AMP image 錯誤
function bbm_amp_modify_json_metadata( $metadata, $post ) {
if (!array_key_exists('image', $metadata)) {
$metadata['image'] = array(
'@type' => 'ImageObject',
'url' => get_template_directory_uri() . '/image/default.png',
'height' => 512,
'width' => 1024,
);
}
return $metadata;
}
add_filter( 'amp_post_template_metadata', 'bbm_amp_modify_json_metadata', 10, 2 );The above solution references
Yigujin's article。
What is AMP?
AMP stands for Accelerated Mobile Pages, which is a solution launched by Google to accelerate website access speed on mobile devices. Simply put, the AMP workflow recodes your website, discarding various unnecessary code and leaving only the content. Additionally, Baidu now also indexes AMP pages. If you are interested, you can directly search for AMP in the WordPress Admin Dashboard to install it. For example, the AMP page for this page is:
https://blog.naibabiji.com/skill/amp-jie-gou-hua-yuan-su.html/ampHow to enable AMP?
If you are using WordPress, enabling AMP only requires installing an AMP Plugin in the Admin Dashboard.
Download Link
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.