🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Resolving AMP Error „Required Structured Data Elements Are Incorrect“_AMP Plugin Download

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-tool
Required Structured Data Elements Error One: logo
The error encountered by Naibabiji was the missing logo address, as shown in the image below.logo的值未填写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 referencesYigujin'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/amp

How to enable AMP?

If you are using WordPress, enabling AMP only requires installing an AMP Plugin in the Admin Dashboard.Download Link

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step instead.

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about Website Building Coaching Service
🔒

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.

×
二维码

Scan to Follow