solution-clips-logo

Details Below

How to fix the Missing field “mainEntity” error
In this article, we explain the Missing field “mainEntity” error. How do we spot it in the google search console? What are the steps we take to fix this error? How long does it take to be recognized by the google search console? If this interests you, continue reading this article. After developing our website, […]
By
Mostofa

In this article, we explain the Missing field “mainEntity” error. How do we spot it in the google search console? What are the steps we take to fix this error? How long does it take to be recognized by the google search console? If this interests you, continue reading this article.

How do we spot THIS Missing field “mainEntity” error?

After developing our website, we submit our website to the google search console. We also submit our sitemap.xml file. A few days later google crawl our website for the first time. So far so good.

google search console notification and email about website Missing field "mainEntity" error

Suddenly we noticed in the notification area that it says one of our pages called FAQ (frequently asked question) Missing the field “mainEntity”. We clicked on it to dig further. And found out that due to this the page is deindexed which we don’t want. Also, google send us a mail about it.

What is this Missing field “mainEntity”?

According to schema.org, this field is a property. The expected type is Thing and as a description “Indicates the primary entity described in some page”, in our case faq page.

What causes this error?

Well as we mentioned this is an FAQ page. We were using a regular block editor to create this section. Technically it is called the accordion section. We are using the Kadence block to create this section. It looks good working just fine for us.

How did this happen?

We use accordion to create our faq section. The accordion block is good for explaining something in a small area. Where the user can be able to click on a section and that section will reveal.

the accordion block looks like this

For us, this is not what we want. We want all questions to be visible and properly coded to meet schema.org requirements.
Now we know there are some markup requirements for the faq page and look for solutions. We found it’s all defined in schema.org and they provide necessary codes as well.

How do we fix the Missing field “mainEntity” error?

This is the code we got from schema.org

<script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [{
        "@type": "Question",
        "name": "What is the return policy?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "<p>The answer is here.</p>"
        }
      }, {
        "@type": "Question",
        "name": "Will I be charged sales tax for online orders?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text":"The answer is here."}
        }]
    }
</script>

We need to place it in the head section of our website just before the </head> tag. Here you can see how to write a question and answer in schema markup. There are other parameters too, but this is the simplest version.
This is the code that we must implement on our FAQ page. And we also found that we didn’t use “mainEntry” in our code.

How we implemented this on our faq page?

As you can see, we need to place the above code in our head section. We are using CMS(WordPress) to create pages and posts. That’s why it’s an easy fix for us. We are using Yoast SEO plugins. This plugin can do a lot of on-page SEO as well as fix schema markups. So why not take advantage of that?

Yoast SEO plugins faq block looks like this

Instead of using the accordion from the Kadence block, we are using the Yoast FAQ block. After inserting the block, we just need to populate the section with questions and answers. It also supports inserting images. Finally, we updated our page and found out “mainEntity” is now present in the head section.

Now we need to fix it for google console:

Since our issues are fixed on our end google didn’t know it yet. We need to notify google. So we go ahead and log into our google search console. Navigate to the Enhancement section and click FAQ.

google faq validation fix confirmation

We see our 1 invalid critical issue. Click and it will take us FAQ> Missing field “mainEntity”. Right away it shows “Done fixing?” VALIDATE FIX. It was performing quick initial validation. And tell us validation started and we see 1 pending item. Now all we wait until validation is done.

About a week later we got another notification and a mail confirmation from google. Where it says FAQ structured data issues fixed for our site. Just to check it is working we quickly use google string site:example.com. And found out our FAQ page is showing the snippet from our site without visiting the site.

after google faq validation fix confirmation this is the result

How long does it take to fix this issue?

It could take a week or maybe more than that. In our case, it took around a week (six days). Whatever the case just waits till it is fixed. When fixed you will be notified through email.

Final Thought:

Whenever anything happens to our site google will notify us through notification and by email. The main takeaway from this case study is regularly to check the site for errors. Also regularly check mail from google to see anything going on. If something comes up don’t worry.
Fix the necessary issues and notify google. It will be fixed eventually so be patient.

Resources

Subscirbe To Our Newsletter