Description
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.
- No more
?author=1redirection to/author/admin - Ignore query var like
author=1orauthor_name=admin - Hide user list in REST API from user without permission
list_usersoredit_others_posts. Single user request likewp/v2/users/1is 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;
} );
- Remove users sitemap (
/wp-sitemap-users-1.xml) from core XML sitemaps. Author archive URLs revealuser_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
- Remove
meta=author - Override author section in Article scheme in JSON-LD
- Hide author section in Slack sharing.
- Hide
article:authorin OGP. - Exclude all authors from XML sitemap.
Installation
Search „hide author archives“ in admin screen.
Altenatively, you can install it manually like below:
- Upload
hide-author-archivefolder to the/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
FAQ
-
This plugin is for sites that do not intend to show author information, but WordPress exposes it unintentionally.
Its scope is machine-readable identifiers such asuser_nicename(usually the same as the login name) in URLs, CSS classes, sitemaps, feeds and REST API, which site owners rarely notice.The author’s display name shown by your theme (e.g.
the_author()in a byline) is out of scope, because the theme and the site owner intentionally output it.
If your theme shows author names you don’t want, change the theme or set a proper display name for each user (by default, display name is the same as login name).Our fundamental goal is covering Core features.
But feel free to let us know and request new features. -
How To Contribute
-
We host plugin on github and any issues and pull requests are welcomed!
Reviews
Contributors & Developers
“Hide Author Archive” is open source software. The following people have contributed to this plugin.
Contributors“Hide Author Archive” has been translated into 2 locales. Thank you to the translators for their contributions.
Translate “Hide Author Archive” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3.0
- Security: Remove users sitemap (
/wp-sitemap-users-1.xml) from core XML sitemaps and exclude all authors from Yoast author sitemap. Author archive URLs in sitemaps revealeduser_nicename, which is usually derived from login name. - Replace author archive links (e.g. author name link in byline) with the posts page. The URL can be changed in Settings > Reading.
- Replace author name in feeds (
<dc:creator>in RSS/RDF,<author>in Atom) with the site name, and remove author URL from Atom feed. - Remove
comment-author-{user_nicename}class from registered user’s comments. - Fix block editor showing „(No author)“ for editors. Single user request in REST API now uses the same capabilities as the user list. Props @ko31.
hide_author_archive_rest_query_capabilityfilter is now also applied to single user request. In that case,$argsis an empty array.- Bump requirements: WordPress 6.6 or later. Tested up to 7.1.
1.2.1
- Add some more filters for Yoast and oEmbed(Core).
1.2.0
- Add override function for Yoast.
1.1.5
- Hide single REST API for single user get
wp/v2/users/1. - Editor can see REST API users get to change author of posts.
1.1.1
- Support REST API.
- Fix coding standards.
1.0.0
- First release
