How to remove URL from Author Name in GeneratePress Theme?

| | ,

Hello Guys, Today in tutorial, we will learn how to remove URL from Author Name in Generatepress Theme. There is a link in author name inside every WordPress theme. When you visit or click on that link, then you see that link.

Through this link, anyone can find your username and it is not right for the security of your website. So the only solution to this is that we can hide or remove this link, which no one can know your username.

So let’s start with how to remove URL from Author Name in Generatepress Theme

remove URL from Author Name in Generatepress Theme

You can hide or delete this link in 2 ways. There are two ways to know.

  1. We can remove this link without plugin
  2. We can remove this link through the plugin.

1. Remove URL from Author Name in Generatepress Theme without plugin.

For the first method you will need GeneratePress’s child theme. If you have a generated child theme, you can install it and if you do not have, I will give you the download link below. You can also download the GeneratePress child theme from there. After downloading you can install this theme in your WordPress website. After installing, activate the GeneratePress child theme.

DOWNLOAD GENERATEPRESS CHILD THEME

Now you have to go to the appearance and there will be an option theme editor, you have to click on it. If a new page will open, then you will get the option of “select Theme to edit” in the right side, then there you have to select the Generatepress child and you will have to click on the Select button next to it. Through this you will be able to edit anything in the Generatepress child theme.

Now the right side will show 2 files, first style.css and second functions.php. You have to click on functions.php.

Now there will be a box at the bottom, there will be some code written in it, you don’t have to do anything with them, by pressing enter on the last line at the bottom you have to copy and paste the code below and then click “Update File”  button below the box for save file.

Code:-


add_filter( 'generate_post_author_output','tu_no_author_link' );
function tu_no_author_link() {
printf( ' ',
sprintf( '%1$s %4$s',
__( '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() )
)
);
}

2. Remove URL from Author Name in Generatepress Theme with plugin

To do this method, you must first install a plugin called code snippets.

remove URL from Author Name in GeneratePress Theme with code snippet

Install Process for Code Snippets Plugin:-

  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.

remove URL from Author Name in GeneratePress Theme with plugin

Then you will have the option of snippets on your dashboard menu and there you will have the option of add new and click on it.

If a new page will open then instead of Enter title here at the top, you have to write Remove Author Link and at the option of the below code, you have to copy and paste the above code. And then you have to do nothing, and you have to click on save changes and activate.

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 on:
Previous

35+ Best Free AMP Blogger Template Download 2021 || Free Download

How to Add Google reCAPTCHA to WordPress comments without plugin

Next

Vishal Kumawat is the Author & Founder of the Geekershub.com. He has also completed his graduation in Bachelor of Computer Applications. He is a part time blogger and full time developer.

Leave a Comment