To prevent people from discovering the admin username, jQuery can be used to remove the href for the author. However, creating a child theme and updating the author meta is the recommended solution. In case of a quick fix, the jQuery code is a viable option.
Additionally, the WP Custom Author URL plugin can be another good solution.
// jQuery code to remove the href attribute from the author link
jQuery(document).ready(function($) {
// Find the anchor element with the author link
var authorLink = $(".entry-meta a[rel='author']");
// Remove the href attribute
authorLink.removeAttr('href');
});
Give it a try, and let me know how that goes! 😄
I’m not exactly sure what you mean by “true admin”.
If you’re referring to the author’s username, WordPress usernames are meant to be seen as public profile URLs (similar to public profile URLs or @handles at big sites and platforms like Twitter, Instagram, YouTube, etc).
Seen from this perspective, WordPress does not consider it a security risk to display these usernames (aka author profile URLs). And note that WordPress is not unique here: other popular website builder platforms like Drupal, Joomla, etc do the same thing.
But the beauty of open-source software is that you don’t have to live with anyone’s “policy”, and you can do as you like. So if you prefer to hide your author usernames — for whatever reason, there is, of course, a plugin for that: https://ww.wp.xz.cn/plugins/wp-author-security/
Good luck!
Thank you Faisal and George for your replys.
George, to answer your question what is “true admin”
For security reasons, I don’t use “admin” name for system admin, I use something else, hence “true admin”. I was hoping to hide that name from the world by using “nickname”, but the system is defeating my whole security plan by displaying “true admin” to the whole world.
Thank you both for sending links to plugins and jQuery solution.
I will give it a try and see which one works the best.
-
This reply was modified 2 years, 10 months ago by
calisun.