Prevents hackers from getting username by using ?author=1 at the end of your domain url

PHOTO EMBED

Thu Jul 22 2021 22:02:00 GMT+0000 (Coordinated Universal Time)

Saved by @Alz #php

// prevents hackers from getting your username by using ?author=1 at the end of your domain url 
// ==============================================================================
add_action('template_redirect', computec_template_redirect);
function computec_template_redirect() {
    if (is_author()) {
        wp_redirect( home_url() ); exit;
    }
}
content_copyCOPY