Skip to content
  • Quick Ref
  • Contact
  • About
wpcanyon.com

wpcanyon.com

Redirect author archives to homepage (or page)

Posted on August 19, 2025 By Admin No Comments on Redirect author archives to homepage (or page)

Redirect Author Archives to Homepage (or Page) in WordPress

If you want to redirect author archive WordPress pages to your homepage or a custom page, this tutorial shows you how to do it quickly and effectively. Author archives often reveal usernames or create duplicate content issues, so redirecting them can improve security and SEO.

Quick Fix

  1. Add a simple PHP snippet to your theme’s functions.php file or a site-specific plugin.
  2. Choose whether to redirect to the homepage or a custom URL.
  3. Test the author archive URLs to confirm the redirect works.

Why This Happens

By default, WordPress generates author archive pages at URLs like yoursite.com/author/username. These pages list all posts by that author. However, if you only have one author or want to hide author information for security or SEO reasons, redirecting these archives is a common approach.

Redirecting author archives prevents:

  • Exposure of usernames that can be exploited in brute force attacks.
  • Duplicate content issues that may harm SEO rankings.
  • Unnecessary archive pages that don’t add value to your site.

Requirements

  • Access to your WordPress theme files or ability to add custom code via a plugin.
  • Basic knowledge of editing PHP files safely.
  • Optional: FTP or hosting control panel access for file editing.

Step-by-step Guide to Redirect Author Archives

  1. Backup your site. Always create a backup before editing theme files.
  2. Access your theme’s functions.php file. You can do this via WordPress Admin Dashboard under Appearance > Theme Editor, or via FTP/cPanel file manager.
  3. Add the redirect code snippet. Copy and paste the following code at the end of the functions.php file:
function redirect_author_archives() {
    if (is_author()) {
        wp_redirect(home_url(), 301);
        exit;
    }
}
add_action('template_redirect', 'redirect_author_archives');

This code checks if the current page is an author archive and redirects visitors to the homepage with a permanent (301) redirect.

  1. Redirect to a custom page (optional). If you want to redirect to a specific page instead of the homepage, replace home_url() with the URL of your choice, for example:
wp_redirect(home_url('/custom-page/'), 301);
  1. Save the changes. Update the file and clear any caching plugins or server caches.
  2. Test the redirect. Visit any author archive URL like yoursite.com/author/username to confirm it redirects correctly.

Common Pitfalls

  • Editing the wrong functions.php file: Make sure you edit the active theme’s file or use a child theme to avoid losing changes on updates.
  • Cache interference: Clear browser, plugin, and server caches after adding the code to see the redirect immediately.
  • Plugin conflicts: Some SEO or redirection plugins may override this behavior. Disable them temporarily to test.
  • Incorrect URL in redirect: Ensure the URL passed to wp_redirect() is correct and includes trailing slashes if needed.

Works on

Server/Environment Compatibility
Apache Fully compatible
Nginx Fully compatible
LiteSpeed Fully compatible
cPanel / Plesk Fully compatible
Any WordPress environment Compatible as long as PHP code can be added

FAQ

  1. Can I redirect author archives without editing functions.php?

    Yes, you can use a plugin like “Redirection” or an SEO plugin with redirect features, but adding code is lightweight and efficient.

  2. Will this affect SEO negatively?

    No, a 301 redirect tells search engines the author archive pages are permanently moved, preventing duplicate content issues.

  3. How do I redirect only specific authors?

    Modify the code to check for specific author IDs or usernames before redirecting. Example:

    function redirect_specific_author_archives() {
        if (is_author('username')) {
            wp_redirect(home_url(), 301);
            exit;
        }
    }
    add_action('template_redirect', 'redirect_specific_author_archives');
    
  4. What if I want to disable author archives instead of redirecting?

    You can disable author archives by returning a 404 status or using SEO plugins to noindex those pages.

  5. Is this method safe for multisite WordPress?

    Yes, but ensure you add the code to each site’s theme or a network-activated plugin if you want it site-wide.

Admin & Blocks Tags:Archives, SEO, Users

Post navigation

Previous Post: BunnyCDN setup for WordPress (origin shield & query‑string cache)
Next Post: Fix WordPress posts returning 404 (pages OK)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Top WordPress Themes for Blogs in 2025
  • WordPress Admin Panel Trick: Adding ID Field to the Posts Listing
  • Solution previous_posts_link and next_posts_link Not Working
  • Show Top Commentators in WordPress Without a Plugin
  • How to Style Admin Comments in WordPress

Recent Comments

    Archives

    • August 2025

    Categories

    • Admin & Blocks
    • Admin & UI
    • Automation
    • Automation & Plugins
    • Comments
    • Comparisons
    • Database & Revisions
    • Developer Snippets
    • Fixes & Errors
    • Media & Thumbnails
    • Queries & Pagination
    • Security
    • Speed & Security
    • Tips & Tricks
    • WooCommerce How‑tos
    • WordPress Snippets
    • WordPress Themes
    • Terms & Conditions
    • Affiliate Disclosure

    Copyright © 2025 wpcanyon.com.

    Powered by PressBook WordPress theme

    Also by the maker of MySurveyReviews.com