Hide the_meta if no value
You can check if there is any meta for the current post by using get_post_meta So to hide/show the div you would wrap your code in an if statement like this… <?php if( get_post_meta(get_the_ID()) ) { ?> <div> <?php the_meta(); ?> </div> <?php } ?>