Get posts by birthday

What you can do is create a meta field under a post and store birth date in that field. Now you need meta_query in you post to retrieve the current date posts.

    <?php $currentDate = current_time( 'Y-m-d' );
$args = array(
    'post_type'  => 'my_custom_post_type',
    'meta_key'   => 'birth_date',
    'order'      => 'ASC',
    'meta_query' => array(
        array(
            'key'     => 'birth_date',
            'value'   => $currentDate,
            'compare' => 'IN',
        ),
    ),
);
$query = new WP_Query( $args );
 if ( $query ->have_posts() ) : ?>

    <!-- the loop -->
    <?php while ( $query ->have_posts() ) : $query ->the_post(); ?>
        <h2><?php the_title(); ?></h2>
    <?php endwhile; ?>
    <!-- end of the loop -->

    <?php wp_reset_postdata(); ?>

<?php else : ?>
    <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

Note :

1) “birth_date” is the key of the meta field that should be created under the post.

2) Format of current date and stored date should be same.

error code: 523