Get 10% Discount On GeneratePress Premium Theme Avail Now

How To Remove URL from Author Name In GeneratePress Theme 2020

Let’s learn how to remove URL from author name in generatepress theme.To remove anchor link from author name in Generatepress in WordPress site, you can use a simple code, I have shared.

  • Save
Remove URL From Author Name

By default, author name contains a hyperlink in any WordPress theme.This hyperlink redirects the people to home page of your site.

If you want to remove URL from author name, then read this article till the end.

I am using GeneratePress premium theme for my website.So I can easily remove anchor link from the author name.

Also Read : How to add author box in generatepress theme

Methods To Remove URL From Author Name In GeneratePress Theme

You can remove author name URL from your generatepress theme, by using two methods.

One method is, to insert code in functions.php of GeneratePress child theme and other is by using code snippets plugin.

Remove URL from Author Name Using Code Snippets

Code snippets plugin
  • Save

Code snippets plugin is one of the best way to add PHP coding to your there’s functions.php file.

Because, if you insert php code into your theme’s straightaway to your theme’s functions.php in theme editor, you can break your site for ever.

So to overcome such a complex situation, you must use Code Snippets plugin which helps to add any PHP code to your WordPress theme without any code break.

Steps To Remove Author Link Using Code Snippets

Firstly, Install and activate code snippets plugin by doing the following steps :

  1. Go to Plugins > Add New Plugin > Code Snippet.
  2. Install and activate the plugin.
  3. Next, Go to Snippets > Add New > Give the title.
  4. Copy the below Code and Paste into the blank space.
  5. Last Save changes and Activate.
  • Save

Copy This Code

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() )
		)
	);
}

Final Result :

  • Save

Recommended Read : GeneratePress Theme Review : Best lightweight theme ever

Remove URL From Author Box Using GeneratePress Child Theme

The above method is best to remove anchor link from author name.

But alternately, you can use GeneratePress child theme to Insert the above code into your theme’s functions.php.

The best thing about GeneratePress theme is that it’s developer Tom Usborne has provided GeneratePress child theme to his Premium users.

You can download the child theme for generatepress from the below link.

This downloaded child theme file will a zip file.You need to upload to your theme.

To install the child theme, save it as a .zip file to your PC.

Then go to Appearance > Themes > Add New > Upload and upload the .zip file.

For better understanding about GeneratePress child theme, go to Child Theme Documentation.

Final Thought

So finally, you see that how easy it is to remove URL from author name in GeneratePress theme.

You can remove author name hyperlink using popular plugin Code Snippets, which is the best way to do.

Besides it, you can use child theme method.

But you must prefer the easy method that is by using code snippets plugin.

Remove URL from Author Name
  • Save

I am Kuldeep Singh a teacher by profession and blogger by great passion. You can learn here blogging related tips and tricks.

Leave a Comment

Share via
Copy link