How To Redirect Author Archive URL To About Page

1 Shares

WordPress blogs are getting too many attacks these days. That case, we need to hide our admin username of the blog. In author archive page, typically WordPress will include the author username on end of the URL. In this post, we will show you that how can you redirect author archive URL to about page or any custom page.

Redirect Author Archive URL To About Page

Hiding the username will help us to protect our blog from author scans and password guessing attacks. So, let’s get started. No need additional plugins for this. All you need is a simple code snippet. if you don’t have multiple authors on your blog, you can disable the author archive settings. So, whenever a website visitor clicks on your author URL, he will be redirected to the WordPress homepage. But the problem is, the username is still visible there.

How To Redirect Author Archive URL To About Page?

First of all, go to the theme editor and choose the functions file. In my case, I am going to add this to Genesis Framework.

genesis functions file

Now, you may want to copy and paste the below code.

add_filter( 'author_link', 'my_author_link' );
 
function my_author_link() {
	return home_url( 'about' );
}

Don’t forget to save the file then.

author archive to url

Before saving the code, simply analyze it. You can see that we have added the slug about in the code. Which means, the code will redirect every website visitors to the specific page according to our permalink structure.

author archive URL redirection

Check your author archive now. You can see the about or custom page there.

author archive url

If you need a live example, check our author URL. The code will work with most themes. If you are having trouble with this code, you may want to reach your theme’s support.

We hope you found this tutorial helpful and enjoyed the read. If you did, please consider sharing our article with your friends on social media. It will help us to write more related posts and them to protect their WordPress blog.

1 Shares

Leave a Reply