Repository navigation
fix(frontend): remove hentry from Tour Operator posts - #1427
Conversation
WordPress adds `hentry` to every post for hAtom microformats. The Post Template block in each query loop uses get_post_class(), so every tour, accommodation and destination item (and extension items such as reviews, specials and team) was read by the Schema Markup Validator as an hAtom blog entry missing entry-title, updated and author. Remove `hentry` from Tour Operator post types on the front end; their JSON-LD schema describes them. Other post types keep it. A new `lsx_to_remove_hentry` filter can keep it for a given post. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Note
|
What
Removes the
hentryclass from Tour Operator posts on the front end. This covers tours, accommodation and destinations, plus any extension post types registered throughlsx_to_post_types(reviews, specials, team).Why
WordPress core's
get_post_class()always addshentryfor hAtom microformats. The Post Template block inside every Query Loop uses it, so each related tour, destination or accommodation item on a page carrieshentry. validator.schema.org reads these as hAtom blog entries and flags them for missingentry-title,updatedandauthor. One example is the related destination and tour loops on/accommodation/bagatelle/on dev.Tour Operator content is described by its JSON-LD schema, so the hAtom class only adds noise to the validator.
How
Frontend::remove_hentry()is hooked topost_classon the front end only, inside the existing! is_admin()block.hentry.lsx_to_remove_hentry ( bool $remove, int $post_id )keepshentryfor a given post if a site needs it.Testing
On beta.local (WordPress Studio), I checked the
wp-block-postitems on pages that hold query loops:/accommodation/clouds-estate/(accommodation and tour loops)hentryon every item/tours/,/specials/,/team/hentryon every item/review/rachel-nigel/(accommodation, destination, team and tour items)hentryon every item/hello-world/(a blog post)hentryhentry, unchangedphp -landphpcs(repo ruleset) are clean on the changed file.Reviewer notes
.hentry.🤖 Generated with Claude Code