Hi @raywarburton,
I was able to reproduce this on a fresh WordPress 7.0 install (PHP 8.3), so this isn’t something specific to your site.
What’s happening: the Post Excerpt block runs every excerpt — manual or auto-generated — through wp_trim_words() before rendering, and that function strips HTML tags as part of the trimming (via wp_strip_all_tags()), even when the excerpt is already within the word limit. In my test, a manual excerpt set via the sidebar “Post > Excerpt” field with a real <a> link rendered correctly as a hyperlink in the editor preview, but the published output was:
<p class="wp-block-post-excerpt__excerpt">Venha descobrir o que temos aqui Lorem ipsum...</p>
The <a> tag is gone, only its text content survived — and this happened even though the link text was well within the “Max number of words” setting, so it’s not a truncation side-effect.
This is a know, currently open issue in Gutenberg core (github.com/WordPress/gutenberg/issues/49449). There’s an in-progress fix (PR #65209) that stops applying the length limit to custom excerpts specifically so formatting is preserved, but as of WordPress 7.0 it hasn’t been merged/released yet.
If you’re comfortable adding a small snippet to a child theme (or a snippets plugin), you can override the block’s output for posts with a manual excerpt so it preserves the HTML instead of stripping it:
add_filter( 'render_block', function ( $block_content, $parsed_block, $block ) {
if ( 'core/post-excerpt' !== $parsed_block['blockName'] ) {
return $block_content;
}
$post = ! empty( $block->context['postId'] ) ? get_post( $block->context['postId'] ) : null;
if ( ! $post || empty( $post->post_excerpt ) ) {
return $block_content;
}
$safe_excerpt = wp_kses_post( $post->post_excerpt );
$new_content = preg_replace(
'/(<p[^>]*class="[^"]*wp-block-post-excerpt__excerpt[^"]*"[^>]*>).*?(<\/p>)/s',
'$1' . $safe_excerpt . '$2',
$block_content,
1
);
return $new_content ?: $block_content;
}, 10, 3 );
This is a workaround, not an official fix, it only kicks in for posts that have a manual excerpt, so auto-generated excerpts keep the normal (safer) trimming behavior.
Hope this helps clarify what’s going on!