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

Resolve AMP Prompt „Required Structured Data Elements are Incorrect“_AMP Plugin Download

Naibabiji installed the AMP plugin recommended by Google, and today received a notification from Google that there is an error in the AMP URL, one of which is „Required structured data elements are incorrect必需的结构化数据元素有误

How to Fix „Required Structured Data Elements Are Incorrect“

The solution is very simple. Use the Google Structured Data Testing Tool, paste the source code of the page with the error, and then check to find out 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 that occurred on Naibabiji is that the logo address is missing, as shown in the figure below.logo的值未填写Now that the problem has been identified, it's easy to solve. Go to the WordPress admin panel, select the Customize function under Appearance. In the Site Identity section, upload a site icon, and then test again; the problem will be gone.站点图标
Required Structured Data Elements Error Two: image
If you still encounter an image error, it's because you haven't uploaded a featured image. There are three solutions: 1. Manually add a featured image to the article. 2. Use a random featured image plugin to batch add featured images to articles.WordPress Random Featured Image Plugin: Random Post Thumbnails3. Use code to set a default featured image for the AMP page. The code is as follows (Naiba has not tested this):
    //修正 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 solutions refer toYigujin's article

What is AMP?

AMP stands for Accelerated Mobile Pages. It is a solution launched by Google to accelerate website access speed on mobile devices. Simply put, the AMP workflow re-encodes your website, discarding various useless code and leaving only the content. Additionally, Baidu now also indexes AMP pages. If you are interested, you can directly search for and install AMP in the WordPress admin panel. For example, the AMP page for this article 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 panel.Download Link

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

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the 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 QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: