Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Author Archives Page – disable via redirect?

  • Hi, I would like to know if I need to disable the Author archives page is it is not used (linked to) on my site.

    How can I view or test this page?

    I do have an “Author header” Element (Type: Block – Page Hero, Location: Author Archives) that is part of the MyPet template.

    So should I disable author archives by redirect to the home page? Via SEO plugin or Code snippets plugin?

    https://www.optimumcreative.com/disable-author-archive-author-page-or-author-url-in-wordpress/

    Should I use this method via the Code Snippts Plugin:

    2- The PHP/Wordpress way

    You can do this by using template_redirect hook. See below code example.

    function oc_author_page_redirect() {
        if ( is_author() ) {
            wp_redirect( home_url() );
        }
    }
    add_action( ‘template_redirect’, ‘oc_author_page_redirect’ );

    You should add above code to functions.php file in active WordPress theme. This code will redirect all author pages to website homepage.

    Or should I use my SEO Plugin (rankMath) with this setting:

    Redirections
    Redirect non-existent content easily with 301 and 302 status code. This can help improve your site ranking. Also supports many other response codes.

    Thanks

  • Hi there,

    if you’re using RankMath then i would recommend you use its settings to “remove” the author archives.

  • Thanks for the recommendation. I now set this via RankMath.

  • Glad to be of help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.