• Resolved djwilko12

    (@djwilko12)


    Hello,

    When using the “ProfilePage”, we should also add what is the main entity of that profile page, for example the person described on the page.

    After I select ProfilePage on Yoast page settings, I run the schema validator and see that Yoast doesn’t add any schema for describing a person (mainEntity). So, how can we “tell” search engines what is that profile page about without adding Person type schema as the main entity?

    Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @djwilko12

    Thanks for reaching out about the ProfilePage schema type. Can you let me know what type of content you have marked as a Profile Page page type in the schema tab of the Yoast SEO meta box? Is it a page or an author custom post type?

    Thread Starter djwilko12

    (@djwilko12)

    Helll @maybellyne

    It is a page where I select, as you said, the profilePage schema type. Waiting your reply.

    [ Please do not bump. ]

    verseone

    (@verseone)

    I have the same error. I’ve created a page and set it as ProfilePage in the Yoast schema box, yet get the “mainentity” missing error in Google’s rich results test

    I have the same problem.

    In Google Search Console the error is:

    Missing field ‘mainEntity’

    Items with this issue are invalid. Invalid items are not eligible for Google Search’s rich results

    Then it lists the URL of a page on my website that is identified by Yoast as having the “profile page” schema. It seems that the Yoast code is no longer current and needs an update to fix this.

    I am facing “Missing field “mainEntity”‘ Issue on author Profile Page? Could you tell me how can I resolve this

    Brandon C

    (@brandon-c)

    Looking for an update on this also. Any word?

    Seanjr88

    (@seanjr88)

    Yoast support keep marking this issue as resolved when it is clearly an ongoing an issue. Crazy ignorance on their part

    • This reply was modified 11 months ago by Seanjr88.
    Brandon C

    (@brandon-c)

    Hopefully we will get some answers soon…

    Eric Amundson

    (@sewmyheadon)

    Hi folks, we had the same trouble and were able to resolve it with a custom function. This function contains site-specific references, but can be adapted to work on your site.

    /** * Update Yoast Profile Page schema markup to include mainEntity */

    add_filter( ‘wpseo_schema_webpage’, ‘update_bio_schema_markup_of_yoast’ );

    /** * Changes @type of Webpage Schema data.
    *
    * @param array $data Schema.org Webpage data array.
    *
    * @return array Schema.org Webpage data array.
    */
    function update_bio_schema_markup_of_yoast( $data ) {
    if ( is_singular(‘lnwm_bio’) ) {
    $bio_title = get_the_title(get_the_ID());
    $teamtitle = get_field( ‘ln_team_title’ );
    $teamtitle = $teamtitle ? $teamtitle : ”;
    $bio = get_field( ‘ln_team_bio’ );
    $bio = $bio ? $bio : ”;
    $data[‘mainEntity’] = (object)[
    ‘type’ => ‘person’,
    ‘ID’ => get_the_ID(),
    ‘name’ => $bio_title,
    ‘title’ => $teamtitle,
    ‘content’ => $bio
    ];
    }
    return $data;
    }

    Full documentation posted the fix here.

    Seanjr88

    (@seanjr88)

    Thanks for the code Alex, however your post and the link is silent on where to insert this code? There are many areas within the Yoast plugin editor.

    Eric Amundson

    (@sewmyheadon)

    your post and the link is silent on where to insert this code??

    Hey @seanjr88 – you’re right.

    The code referenced is an example of code that we used on a custom project for a customer and is definitely site-specific.

    In this case, we’re only adding the mainEntity parameter on posts within the custom post type (lnwm_bio).

    The code would need to be adapted for your application and included either in your theme’s functions.php file or a custom plugin.

    The key is using this wpseo_schema_webpage filter to filter or add to the schema output.

    I hope that helps!

    I too found the missing mainEntity in Google Search Console. It related to my “About Me” page, which I must have assumed at some point meant I should select Profile page in yoast schema.

    I’ve now changed the page type back to default, but would like to know how we’re actually meant to deal with our “About” pages.

    Adding additional code is probably a step too far for me.

    Hey @choclette,

    If you’re using Yoast, I’d select the About page type under Schema for your About page:

    I hope that helps!

    Thanks Eric. Can’t believe I didn’t see that before. I’ll try it out and see if I get another Google error.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Missing main entity on profile page type’ is closed to new replies.