diff --git a/packages/block-library/src/tag-cloud/index.php b/packages/block-library/src/tag-cloud/index.php index 69b8c25ec8720..8949dd8e5b11f 100644 --- a/packages/block-library/src/tag-cloud/index.php +++ b/packages/block-library/src/tag-cloud/index.php @@ -29,8 +29,13 @@ function render_block_core_tag_cloud( $attributes ) { ); $tag_cloud = wp_tag_cloud( $args ); - if ( ! $tag_cloud ) { - $tag_cloud = __( 'There’s no content to show here yet.' ); + if ( empty( $tag_cloud ) ) { + // Display placeholder content when there are no tags only in editor. + if ( wp_is_serving_rest_request() ) { + $tag_cloud = __( 'There’s no content to show here yet.' ); + } else { + return ''; + } } $wrapper_attributes = get_block_wrapper_attributes();