Article Schema error (mainEntityOfPage)

#87696
Viewing 11 replies - 1 through 11 (of 11 total)
  • Version 1.0.47.1 – installed this version and the problem is missing

    The error appears if you do not manually set the canonical link. The latest version (1.0.48.1) still has a bug.

    Bill
    Rank Math free

    Thanks Pro!

    I was getting the same errors:

    LocalBusiness is not a known valid target type for the publisher property.

    The mainEntityOfPage field is recommended. Please provide a value if available.

    Rolling back fixed it.

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    We were able to reproduce the error and have logged it. Please allow us some time to test and release a fix. For now, to fix the issue on your site, please add following filter code in your theme’s functions.php file:

    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if ( isset( $data['richSnippet'] ) && ! isset( $data['richSnippet']['isPrimary'] ) ) {
    		$data['richSnippet']['isPrimary'] = true;
    	}
    
    	if ( ! empty( $data['publisher'] ) && 'Organization' !== $data['publisher']['@type'] ) {
    		$data['publisher']['@type'] = [
    			'Organization',
    			$data['publisher']['@type']
    		];
    
    		if ( ! empty( $data['publisher']['image'] ) ) {
    			$data['publisher']['logo'] = is_array( $data['publisher']['image'] ) ? $data['publisher']['image'] : [
    				'@type' => 'ImageObject',
    				'url'   => $data['publisher']['image'],
    			];
    		}
    	}
    
    	return $data;
    }, 99, 2);
    

    I hope that helps. Thank you.

    This code removed the errors.
    Please let us know when you can remove this code.

    Hello,

    When we release the next update with a fix, this code will be automatically overwritten.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Bugs have gone away on posts that are posted this month. Posts created 2 years ago are getting errors. I have over 100 errors already. Needed to roll back to version .7.1.

    For old posts, the scheme is applied and errors disappear only after the scheme is regenerated.
    I have too many posts to do this.

    sir, I am facing a problem
    Logo
    http://exmple.in/wp-content/uploads/2020/06/default-2-1.png (A value for the url field is required ) in rich snippet
    and how to solve this problem

    • This reply was modified 4 years, 2 months ago by Kundan Sah.

    Hello,

    We released a quick update to fix this issue. Please update the plugin on your site and let us know if the issue is resolved.

    Make sure to clear your cache and hard refresh your browser after you have updated.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    We will get back to you on that ticket.

Viewing 11 replies - 1 through 11 (of 11 total)

The ticket ‘Article Schema error (mainEntityOfPage)’ is closed to new replies.