I have one critical issue Missing field ‘mainEntity’
in the Q&A Google search console
for the QA page schema
. Items with this issue are invalid. Invalid items are not eligible for Google Search’s rich results. Error in Google search console due to Yoast schema script
on one of my website pages.
The code was added by the Yoast plugin
installed at my end. Earlier I was not getting this error when the page type schema was set as a Web page
. Now, I am getting this error after setting the page type schema as QA page
in Yoast premium plugin
.
This was the discussion between me and the support to resolve this issue.
Support:
You will get the
Missing field “mainEntity”
error if you set a page as an FAQ page and you don’t use the Yoast SEO FAQ block. So, you need to use the Yoast FAQ block on that particular page. This guide explains more on how you can use the Yoast SEO FAQ block: https://yoast.com/how-to-build-an-faq-page/#how.Admin:
No, I did not set FAQ. I set it as a QA page. This is the Yoast setting at my end.
Support:
If you set the page to be a QA page, there needs to be a Yoast FAQ block on the page to fill the schema. Not having this will result in an
incomplete/invalid Schema graph
. Please refer to: https://yoast.com/how-to-build-an-faq-page/Just adding the FAQ block with your questions and answers would make the plugin output the correct information too.
Admin:
My website is a Question and Answer based website where one can ask questions on the website itself and anyone can answer and any number of answers are allowed. There is no option there to use the FAQ block on UI. If I go to WordPress and try to write the blog at the back end, then I can select FAQ block only. I hope you are getting what I am trying to say.
You will see that no backend is involved in this Question and Answers (treated as comments). I need to set it as a QA page only.
Also, If you look at my website you will observe that the WordPress backend is not involved anymore since users can ask questions on the website UI using the Ask a Question button and Answers will be given there by multiple users located at different places. So, I am not writing a blog at my backend on WordPress. Questions and Answers are governed by the website user interface.
Since each page contains one question and multiple answers (a type of discussion) on the question on each page.
Please understand that I want to set this as the QA Page that corresponds to web pages that contain data in a question-and-answer format, which is one question followed by answers.
Please suggest how to resolve this issue as I intentionally set the pages as QA pages and I got this issue. If I was putting questions from the WordPress backend then I was able to use your FAQ block. Also, I am not using FAQ page type instead using QA page type.
Support:
Let me explain this this way: the QA schema will only show its complete schema pieces if the FAQ block is used. Since this isn’t the case, the QA schema will be incomplete, thus triggering the main entity error. That said, you can select the webpage schema instead to avoid further errors. If you need to change the schema behavior, you can customize the plugin’s schema output. You can use the Schema API that allows developers to customize the Schema output of each of our plugins. Please refer to our Schema API documentation here: https://developer.yoast.com/features/schema/api/.
Admin:
Ok. I will check the API, but I cannot switch back to Webpage schema as earlier by default it was set as webpage scheme and there was no such error. But my website is based on Q&A where everything happens on UI whether it’s asking questions or answering them.
I have used the discy theme. They also used the QA page as schema type.
See I cannot use the FAQ block as that is only available when I create a new page from WordPress and then I can use your toast FAQ block. This is not the case at my end.
Now Discy whose theme I purchased used the same QAPage schema and they seem to have the correct schema on their (view-source:https://2code.info/demo/themes/Discy/Main/question/is-this-statement-i-see-him-last-night-can-be-understood-as-i-saw-him-last-night/) page and the one which is outputted by Yoast plugin at my end showing error
However, I can see the
“mainEntity” field missing
in my schema and instead, see the“mainEntityOfPage”
field.Please don’t recommend me to switch back to Webpage schema as I will never do that. I have to be on the QA page schema type only. Please help me with the detailed steps to resolve it on my website.
What is the difference between the FAQ page and the QA page?
FAQ page is where we have multiple questions and multiple answers in a block, then that is fine i should use your FAQ block for this type of page I will create by myself at the back end means from WordPress create page option.
However, the QA page is a page where we have one question and multiple answers that’s what my page is. From UI, one can ask questions and once the question is submitted, a page is created and there is no point in using the Yoast FAQ block here from website UI. Now anyone can answer, or reply from the UI itself any number of times.
Since, I have set the schema page as a QA page not as a FAQ page, your Yoast plugin should be able to add the field “MainEntity” on my page without making any check for the Yoast FAQ block used or not.
The Yoast plugin did not populate the “MainEntity” field on my page and that caused the parsing error in the Google search console please try to understand that this is a critical error on my website.
In case any new page added to the website when anyone asks a question on the website then this happens to those pages as well which will be going to be created on my domain.
Now once the Google bot crawls again it may throw the same critical error for all my pages on the website. Please help to resolve it.
Support:
Looking at the page, I can confirm that your theme natively supports the QAPage schema. For the schema from your theme to work correctly, I recommend that you first change the schema type in the Yoast Metabox to WebPage. After updating this schema, your page will show the QAPage schema without any warning. With the Yoast schema, you will be getting 2 QAPage schemas. It shows the duplicate QAPage schema. You only need 1 schema so should you use the WebPage schema so you won’t be getting any warning regarding the QAPage schema.
Admin:
Thanks for the clarification. I have set up the page type schema as Webpage as Discy theme by default support QA page schema. After that, the
Missing field ‘mainEntity’
error ispassed
in theGoogle search console
.Missing field ‘mainEntity’
validation passed in the Google search console after setting up the webpage type schema in the Yoast premium plugin.