I think this is function of WordPress … WordPress creates automatic pages for things like categories, tags, authors/users, etc. — the theme only changes the look of those things, it doesn’t create new pages, posts or tags for you, or users.
Whenever you create a new user, there is an index for that user under their username, and even under the user-id. It is basically the same as an archive, except has a custom template. Typically there would NOT be an index for a “subscriber,” AFAIK. But editors, and contributors, all get author indexes by default.
You can hide “empty” author indexes from your sitemap using Yoast SEO; which I do. 🙂
In things like author widgets (“featured authors”) you can hide un-used and admin authors by their author ID code.
-
This reply was modified 11 years by
simchris.
Hi Chris,
Thanks for the quick reply! Excellent support. So subscribers will have author pages created for them on signing up? I’ve been looking for a fix to direct subscriber author pages to 404, or preferably not create them at all. Really sorry if this isn’t theme related, I’ll direct that one to WordPress.
Also I was wondering whether the top bar sign in could be linked. I’ve created a page for editing user profiles without the dashboard on the front end. I was hoping to add this link to the td_user_logd_in call href call.
Make sure you have your default “user role” in WP set to “subscriber.” A new user should not be able to have an “author” index, since a subscriber cannot make posts, only “view” posts. See the official WordPress CODEX on “user roles” for more information on that 🙂
That’s what I’ve been so confused about, it’s subscribers that are getting author pages. I thought it might be the theme but now I’m wondering whether it could be a plugin issue. Example at http://www.xposy.com/author/testsubscriber – Account I made with default user role set to subscriber. Very strange!
Well, I’ve fixed this for now by throwing a 404 on the author.php if !have_posts, but this meant changing the author.php template. I don’t know if this is going to fix much. These pages may still be included within the sitemap. Hopefully I haven’t messed with any functionality of the author template. For anyone dealing with the same issue, in your parent theme > author.php add:
<?php
if (!have_posts()) {
header(“HTTP/1.0 404 Not Found – Archive Empty”);
require TEMPLATEPATH.’/404.php’;
exit;
}
get_header();
?>
To the very top of the file. Unfortunately these are still being indexed, so I’m expecting a few errors in Webmaster Tools.
-
This reply was modified 11 years by
Sean.
I realised this doesn’t overwrite existing header information created by certain plugins such as Yoast SEO. Instead, place this at the top of the author.php file:
<?php
if (!have_posts()) {
global $wp_query;
$wp_query->set_404();
require_once( trailingslashit( get_template_directory() ). ‘404.php’ );
exit;
}
?>
Also, in your YOAST SEO setup for XML sitemaps — they *did* add option this year to NOT include authors by user role, so you can check the
EXCLUSE
[X] admin
[X] subscribers
this will keep out admin and subscriber posts from sitemap; and only those with actual editor, contributor (writers) roles in the sitemap(s).
Sorted the top bar log-in section with a quick change to top-menu.php:
<li class=”menu-item”>’ .
get_avatar($current_user->ID, 20) . ‘<Your Anchor>’ . $current_user->display_name . ‘<End Anchor><i class=”td-icon-logout”></i>’ .
And the following CSS:
.td_user_logd_in{
cursor:pointer!important;
}
Looks like I’m all sorted!