//Create WordPress Query with 'orderby' set to 'rand' (Random)
$the_query = new WP_Query( array ( 'orderby' => 'rand', 'posts_per_page' => '1' ) );
// output the random post
while ( $the_query->have_posts() ) : $the_query->the_post();
<a href="<?php echo get_permalink(); ?>" >Текст ссылки</a>
endwhile;
// Reset Post Data
wp_reset_postdata();