Directory / plugin

Hide Author Archive

v1.3.0 · by Tarosky Inc.

Hide author archive URL of WordPress.

About this plugin

This plugin will hide author’s archive.
If your don’t need author parameter, this plugin may enhance your site’s security from bot inspection.

  1. No more ?author=1 redirection to /author/admin
  2. Ignore query var like author=1 or author_name=admin
  3. Hide user list in REST API from user without permission list_users or edit_others_posts. Single user request like wp/v2/users/1 is also hidden with the same capabilities, except for the user themselves and users who can edit the user. This capability is filterable.
/**
 * Filter capabilities to see author list and single author.
 *
 * For single user request, $args is an empty array.
 *
 * @param string[]             $caps    List of capabilities.
 * @param array                $args    Arguments for user query.
 * @param WP_REST_Request|null $request Request object.
 */
add_filter( 'hide_author_archive_rest_query_capability', function( $caps ) {
    $caps[] = 'read';
    return $caps;
} );
  1. Remove users sitemap (/wp-sitemap-users-1.xml) from core XML sitemaps. Author archive URLs reveal user_nicename, which is usually derived from login name.

Besides that, this plugin tries to remove author information from meta tags and JSON-LD as possible as it can.

  • Override author section in oEmbed.
  • Replace author archive links (e.g. author name link in byline) with the posts page, because the link contains user_nicename. You can change the URL in Settings > Reading.
  • Remove comment-author-{user_nicename} class from registered user’s comments.
  • Replace author name in feeds (<dc:creator> in RSS, <author> in Atom) with the site name. Author’s URL is also removed from Atom feed. Display name is the same as login name by default, so feeds may reveal it.

Some organization needs to hide author information of each article.

Supported Plugins

Yoast

  1. Remove meta=author
  2. Override author section in Article scheme in JSON-LD
  3. Hide author section in Slack sharing.
  4. Hide article:author in OGP.
  5. Exclude all authors from XML sitemap.

Plugin tags