Home Experience & Tips Sharing Standard Post

Standard Post

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

Naibabiji installed Google„s recommended AMP plugin and received a notice from Google today that there are errors in the AMP URLs, one of which is “Required structured data elements are incorrect„. Solution to “Required structured data elements are incorrect„: The solution is simple. Use Google“s Structured Data Testing Tool to paste the source code of the erroneous webpage, then...

Updated on November 21, 2019 About 3 minutes reading
解决AMP提示“必需的结构化数据元素有误”_AMP插件下载

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 simple. Use Google's Structured Data Testing Tool to paste the source code of the erroneous webpage, then check it to find out the problem.

Google Structured Data Testing Tool URL: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 is found, it's easy to solve.

Go to WordPress admin, select Appearance > Customize. Under Site Identity, upload a site icon, then test again. The problem will be gone.

站点图标

Required Structured Data Elements Error Two: image

If you still get an image error, it's because you haven't set 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 postsWordPress Random Featured Image Plugin: Random Post Thumbnails

3. 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 speed up website access on mobile devices.

Simply put, AMP's workflow is to re-encode your website, discarding various useless code and leaving only the content. Additionally, Baidu now also indexes AMP pages. If you're interested, you can search for AMP directly in the WordPress admin and install it.

For example, the AMP page of 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 panel.

Download Link

5/5 - (1 vote)
Previous WordPress Mini Program Open Source Version Installation and Usage Tutorial Continue reading content around the same timeline. Next Method to Display a „Read More“ Button for Posts on the WordPress Homepage View the next related tutorial or experience.

AI Website Building Assistant

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