Wordpress wp_loginout nofollow noindex tweak
Tags: nofollow, wordpress
If you use the Wordpress Log In link in your wordpress theme, one thing that is probably worth doing is modifying your wp_loginout function to add rel=”noindex,nofollow” as per the example below. It’s a very straightforward tweak.
We’re led to believe “nofollow” will prevent page rank being passed to the linked pages, the aim being to prevent dilution of your site’s pagerank by having it distributed over too many pages, whilst “noindex” will prevent the page behind the link being indexed by search engines, assuming the page can’t be found and indexed by other means that is.
You can find the below function in “/wp-includes/general-template.php” on line 34. Add rel=”Noindex,Nofollow” as shown below.
function wp_loginout() {
if ( ! is_user_logged_in() )
$link = '<a href="' . site_url('wp-login.php', 'login') . '" rel="noindex,nofollow">' . __('Log in') . '</a>';
else
$link = '<a href="' . site_url('wp-login.php?action=logout', 'login') . '">' . __('Log out') . '</a>';
You don’t want to waste any of your sites pagerank on a login page, and this should keep the login page out of the search engines (those which obey “noindex” anyway). Since anyone wanting to attack wordpress installations first needs to identify sites that run wordpress, one of the best methods of security (after proper security) is to keep the platform that your website runs on as anonymous as possible, and keeping this page out of search engines is a good start.
Remember, you are modifying the core in doing this, so when/if you upgrade your wordpress installation, you will probably need to redo this tweak.


