Skip to content

Commit

Permalink
fix: broken yoast breadcrumbs in webpage schema
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimds committed Nov 14, 2023
1 parent 25907ca commit d029369
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion web/app/themes/awasqa/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,11 @@
return null;
}
return $value;
}, 10, 3);
}, 10, 3);

// Remove breadcrumbs from yoast site schema as Google thinks they are invalid
add_filter('wpseo_schema_graph_pieces', function ($pieces, $context) {
return \array_filter($pieces, function ($piece) {
return ! $piece instanceof \Yoast\WP\SEO\Generators\Schema\Breadcrumb;
});
}, 11, 2);
2 changes: 1 addition & 1 deletion web/app/themes/awasqa/src/wpml.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function connect_translations_page()

add_filter('get_block_templates', function ($query_result, $query, $template_type) {
if ($template_type !== "wp_template") {
return;
return $query_result;
}
$not_found_text = __('Not found: %1$s (%2$s)');
$not_found_part = explode(":", $not_found_text)[0] . ": ";
Expand Down

0 comments on commit d029369

Please sign in to comment.