Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
How to block google from indexing yourl? #2202
Why would you want to?
By allowing Search Engines to crawl your YOURLS site, will transfer link juice from the short url to the long one.
To prevent honest Search Engines from crawling your whole site, or even one URL, you could use robots.txt (Google robots.txt for info).
YOURLS links are not "indexed". If Googlebot finds a YOURLS link, eg a page somewhere or a tweet contains http://sho.rt/blah, Googlebot will follow it and, if allowed by the destination, index and archive the destination page.
YOURLS links are only redirects, they are not indexed by Google.
If your question is "how do I prevent Google from following YOURLS links", answer is "make a custom plugin that checks user agent before redirection to prevent googlebot from being redirected"
Just wanted to mention here that Google is indexing yourls short links for me.
I added robots.txt file few days ago but it only seems to prevent indexing of content (on some links but not all at the moment) but the links still make it to Google search results.
Google suggest adding to meta tags which is not applicable in case of redirected links. The other option is the X-Robots-Tag HTTP header... implementation of which is outside my area of expertise. Just wanted to post this here in case some developer would consider making a plugin that can do this?
This is not that big of a deal for me except that it seems to pollute the site search results for my domain as I am using the same domain (subdomain) for YOURLS. I am not sure if it is hurting my site's ranking/authority in Google's eyes as these links end up redirecting to other domains :) Cheers.
https://developers.google.com/search/reference/robots_meta_tag does not indicate that these are deprecated.