Home / Archive / Remove Author Links
Duplicate Snippet

Embed Snippet on Your Site

Remove Author Links

If you are disabling author archives on your site you will want to remove the author links from the front-end of your site. This snippet removes the author links from the author bio and post meta.

Code Preview
php
<?php
// Remove the author link from bio.
add_filter( 'wpex_post_author_bio_data', function( $data ) {
	unset( $data['posts_url'] );
	return $data;
} );
// Remove the author link from code functions which display in post meta.
add_filter( 'the_author_posts_link', function( $link ) {
	if ( ! is_admin() ) {
		return get_the_author();
	}
	return $link;
} );

Comments

Add a Comment