Remove / Fix ‘hentry’ Errors in your Theme Templates

The combination of the WPSSO Core plugin and its WPSSO Schema JSON-LD Markup add-on should provide you with error free Schema markup when validating your webpages with Google’s Structured Data Testing Tool — but some hatom / markup in your theme’s templates may show some errors.

One such error might be from your theme’s use of the ‘hentry’ CSS class, which is meant to define an article code block, that must contain additional markup for the author, published date, etc. Unfortunately, in some cases, this additional markup is missing, thus creating an error for ‘hentry’ in Google’s Structured Data Testing Tool. In all cases, you should report the error to the theme’s author so they can fix their templates (more information on how to complete the ‘hentry’ markup).

Meanwhile, here’s a quick fix to remove the ‘hentry’ CSS class from your theme’s templates (provided your theme uses standard WordPress filters) — simply add the following code to your theme’s functions.php file. Since the WPSSO JSON add-on includes all necessary article information in the JSON-LD markup, the ‘hentry’ information is redundant and can be safely removed. ;-)