• Resolved hiiab

    (@hiiab)


    I have an issue on this page https://bitterwinter.org/ I have 10 errors marked as follow “NewsArticle is not a known valid target type for the blogPost property.” How can I fix this issue?

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

Viewing 1 replies (of 1 total)
  • Plugin Author Hesham Zebida

    (@hishaman)

    The error message is self explanatory! Blog posts must be BlogPosting.

    There is a solution though, which is remove the Blog markup entirely since it’s not valid in this case.

    You can use a code like this in your Theme’s functions.php file:

    add_filter( 'schema_blog_output', 'schema_blog_output_remove_8987716235' );
    /**
     * Remove Schema Plugin markup for Blog on home page
     *
     * @param array $schema
     * @return array 
     */
    function schema_blog_output_remove_8987716235( $schema ) {
        
    	// Simply return an empty array
    	return array(); 
    }

    Here is a link to the gist where you can get this code snippet.

    *Another solution is to get Schema Premium, it has a way to select markup type, you can set markup type to Blog or ItemList. The ItemList allow listing content with different types than Blog Post. Check out the Schemas settings for more details.

Viewing 1 replies (of 1 total)
  • The topic ‘Blog post/news article’ is closed to new replies.