diff --git a/core-blocks/archives/index.php b/core-blocks/archives/index.php
index b6e6d06ab4e44d..9c221590e5c31d 100644
--- a/core-blocks/archives/index.php
+++ b/core-blocks/archives/index.php
@@ -57,6 +57,12 @@ function render_block_core_archives( $attributes ) {
$block_content = '
';
+
+ $block_content = sprintf(
+ '
%2$s
',
+ esc_attr( $class ),
+ $block_content
+ );
} else {
/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
@@ -68,13 +74,13 @@ function render_block_core_archives( $attributes ) {
$archives_args['echo'] = 0;
$block_content = wp_get_archives( $archives_args );
- }
- $block_content = sprintf(
- '%2$s
',
- esc_attr( $class ),
- $block_content
- );
+ $block_content = sprintf(
+ '',
+ esc_attr( $class ),
+ $block_content
+ );
+ }
return $block_content;
}