• Resolved rajk748

    (@rajk748)


    Hello,

    Getting Missing field “mainEntity” error in Google Search Console for author profile page. I saw another post with same error with the response that issue will be resolved in next update. There was a plugin update couple of days back and just wanted to inform that it has not resolved the issue for me.

    Please ignore the post if the update was not addressing this particular issue. I just wanted to give feedback to the developers.

    Thanks.

    Raj

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Prabhat

    (@prabhatrai)

    Hey @rajk748,

    Thanks for reaching out and I apologize for the issue you’re facing!

    Yes, our last update didn’t include the fix and it’ll likely be added in our next release. I’ll ensure to notify you as soon as we release the fix.

    Meanwhile, I can share a code snippet that will add the missing mainEntity property to fix the issue.

    Here’s the code snippet which you can use with our WPCode plugin –

    add_filter( 'aioseo_schema_output', function ( $schema ) {
    	foreach ( $schema as &$schemaItem ) {
    		if (
    			empty( $schemaItem['mainEntity'] ) &&
    			isset( $schemaItem['@type'] ) &&
    			'ProfilePage' === $schemaItem['@type']
    		) {
    			global $wp;
    			$current_url              = untrailingslashit( home_url( $wp->request ) );
    			$schemaItem['mainEntity'] = [
    				'@id' => $current_url . '/#author'
    			];
    		}
    	}
    	return $schema;
    } );

    Please follow the steps below to add this code snippet to your site using our WPCode plugin:

    1. Log into your WordPress site and go to Plugins > Add New.
    2. In the Search plugins field (top right), enter WPCode.
    3. Click on the Install Now button next to the result for WPCode as shown in this screenshot – https://a.supportally.com/i/tpZaaJ
    4. Click on the Activate button.
    5. Next, go to?Code Snippets > + Add Snippet?in the WordPress menu and click on the?Use Snippet button that appears when hovering on the Add Your Custom Code (New Snippet) block as shown in this screenshot – https://a.supportally.com/i/DrXANx
    6. Add any title like Add missing mainEntity to ProfilePage Schema
    7. Set Code Type to PHP as shown here – https://a.supportally.com/i/41u8Dm
    8. Paste the above code into the text box and Save Snippet after Activating the snippet – https://a.supportally.com/i/XLMRxJ

    This will add the missing field to the schema. However, please note that Google will see the changes only after crawling your website again.

    So, after activating the snippet, I suggest you clear your website’s cache and wait for Google to crawl your website again and see the changes.

    Please let me know if you have any questions.

    Thanks!

    Plugin Support Prabhat

    (@prabhatrai)

    Hey?@rajk748,

    Thanks for your patience!

    I’m excited to announce the release of All in One SEO version 4.5.6. This latest update includes the fix for the “missing field mainEntity” error that you were getting in your Google Search Console account.

    I recommend updating your AIOSEO plugin to version 4.5.6 at your earliest convenience. This update not only addresses the previous issue but also brings additional enhancements to the plugin.

    For your reference, here is our complete changelog – https://aioseo.com/changelog/

    To update the plugin, simply navigate to the ‘Plugins‘ section in your WordPress Dashboard, locate All in One SEO, and click ‘Update Now‘. Alternatively, you can go to WordPress Dashboard > Updates.

    After updating, we suggest checking that all functionalities are working smoothly on your site. Google would also update the error in your Google Search Console account after crawling your site again.

    You can now disable the code snippet I shared previously as the fix is by default included in this release.

    Your experience and satisfaction with our plugin are of utmost importance to us.

    Should you face any difficulties during the update process, or if there are any further concerns you wish to address, our support team is on standby to assist you. Please do not hesitate to reach out for any help you might need.

    Thank you once again for your patience and for choosing AIOSEO for your SEO needs.

    Thread Starter rajk748

    (@rajk748)

    Hey @prabhatrai

    I can confirm that the issue has been resolved.

    Thanks a lot for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Profile page structured data issues Missing field “mainEntity”’ is closed to new replies.