• I’ve recently become the webmaster of a wordpress multisite with 95 sites. I found out that google had wp-admin indexed, which I know is not ideal. I added a .htaccess to the wp-admin directory with Header set X-Robots-Tag "noindex, nofollow", but it is still indexed. I believe this is because the footer on every site has a link to wp-admin. I am aware that optimum security would involve no linking to wp-admin, but the population of users is not tech savvy enough to find the login page without that link.

    I would like to set all the links to be nofollow, which I think should resolve the issue(?), but I’m not sure how to do it without touching every site. What are some good options for this? Right now, I am thinking of making a plugin with a wp_footer hook that uses preg_replace to add nofollow dynamically. Is that the best option?

    • This topic was modified 1 year, 7 months ago by James Huff. Reason: moved to Networking WordPress since this is a multisite issue
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Is this footer link the only problem link? You could replace the link with a DOM element that only looks like a link and have related JS do the actual redirect to wp-admin. If you use inline JS to do this, you’ll need to obfuscate the URL because Googlebot will pick URLs out of inline scripts and follow/index them. One way to do so is assign various URL elements to vars and concatenate the vars to construct the window.location.assign() statement.

    Even if you take all appropriate measures, if the URL has already been indexed, it’ll take a long while for it to be removed. You can request certain URLs be removed from Google through Search Console.

    Thread Starter plainrane

    (@plainrane)

    The issue is more that there are 95 sites and I’m trying to figure out the easiest way to apply the fix to all of them without having to go into each site.

    Moderator bcworkz

    (@bcworkz)

    The best solution depends on how the problem link gets output. If it’s part of the footer template code, you may need to alter that theme’s template file. You’d need to do it for every theme with such a link. I doubt every site is using its own unique theme, there’s typically a limited number of themes available.

    If the themes use a function call to output the link, that function might possibly apply a filter which you could hook from a custom plugin to alter the function’s return.

    If the link is output from a widget, the widget could also possibly apply a filter which you could hook.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding nofollow to all links to wp-admin on a multisite’ is closed to new replies.