Join WPLogout Community on Facebook Join Now

How to remove URL from Author Name in GeneratePress Theme?

In this tutorial, we are going to learn to remove URL from Author Name in Generatepress Theme. By default, there is a link in Author Name in every WordPress theme. When you hover over the author’s name you can see the link.

The link reveals the WordPress username. so the best solution for this is to hide or remove the URL/link from the Author Name.

Remove Link from Author's Name

As I am using GeneratePress Premium Theme. There are many ways to insert a code in GeneratePress but here we are using a plugin Method.

Here, we are going to use the Code Snippets plugin. It is one of the best plugins to insert PHP Snippets in functions.php.

Every time you use the theme’s functions.php, you may mess up with the original theme codes.

so for that, you don’t have to create a child theme as Code Snippets plugin provides the extended functionality to insert PHP code in WordPress sites.

Alternative Method: You can create a GeneratePress Child Theme and you can use functions.php to insert the following code.

The best thing about a GeneratePress child theme is that you don’t have to create yourself. Tom Usborne, the found and lead developer of GeneratePress has created a child theme for you.

Also Read: Display Related Posts in GeneratePress Theme

Remove URL from Author Name in GeneratePress Theme

Follow the simple step to Remove link from Author Name in GeneratePress Theme.

  1. Go to Plugins > Add New > Install Code Snippets
  2. Activate the Code Snippets Plugin.
  3. Go to Code Snippets > Add New
  4. Add the Following Code.
  5. Activate it.
add_filter( 'generate_post_author_output','tu_no_author_link' );
function tu_no_author_link() {
	printf( ' <span class="byline">%1$s</span>',
		sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <span class="fn n author-name" itemprop="name">%4$s</span></span>',
			__( 'by','generatepress'),
			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
			esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
			esc_html( get_the_author() )
		)
	);
}
Removing Link from Author Name in GeneratePress using Code Snippets plugin

Bottom lines

I hope this Remove URL from Author’s Name code will help you to get the desired result.

If you have any feedback/comments, please feel to comment or contact us.

Share:

GET 100+ FREE SEO TOOLS

Quickly access over 100+ popular SEO/Marketing tools to Boost your website traffic.

Thank you for subscribing. Check your Email(Didn't receive? check Spam Folder)

Something went wrong.

I am obsessed with WordPress and write articles about WordPress Speed Optimization, SEO, Blogging. I mostly publish tutorials on GeneratePress and GenerateBlocks.

8 thoughts on “How to remove URL from Author Name in GeneratePress Theme?”

    • Hi Vishesh, I have tested the code in a free theme too. The code is perfectly working.
      1. Go to Plugins > Add New > Install Code Snippets
      2. Activate the Code Snippets Plugin.
      3. Go to Code Snippets > Add New
      4. Add the above Code.
      5. And don’t forget to Activate it.

      Also, can you mention the steps you have done?

      Reply
  1. brother can you make a tutorial on ‘how to create shadow box around all images in blog posts in generatepress like your website?

    Reply
    • Hi Roshan,
      I have implemented the same code on my website and it is working fine without any problem.
      1. Please Check at Settings > Discussion, if there is Avatar Display Off.
      Thanks

      Reply

Leave a Comment