How to Hide Affiliate Links from Google to Avoid Being Penalized

Many of us use affiliate marketing to earn money from our blog because it is the most profitable way to make money online.
A lot of experts are saying that for affiliate campaign to be profitable, you have to make your link look nicer. So, for example, many are hiding their affiliate with something like http://www.domainname.com/go/affiliate-name. There are some free plugins that can help you hide your affiliate link and keep track of how many clicks they are receiving, for example, if you use WordPress you can try something like: Redirection
Google says that you won’t be penalized for an affiliate link like the one mentioned above. But many SEO’s and affiliates around the world think otherwise. In my opinion, it would be better to be safe than sorry, because fixing this will not be hard and will not involve a lot of time from your side. Below, I will present you the steps that you have to follow to hide your affiliate links from search engines and avoid getting penalized.

1.   Check for robots.txt

Most of the blogs and sites are already using robots.txt,
 to check if you use it go in the root folder where you have the site installed and check for a file called robots.txt or just type http://www.domainname.com/robots.txt and a page with some text like in the below picture should appear:
If you are not able to find the file or no page like in the above image opens, it means that  you have to create the file  yourself. Just go in the root directory where you have the site and create a robots.txt file.

2.   Hide affiliate links from search engines

Now, you just have to edit robots.txt file and add:
Disallow: /go/
under:
User-Agent: *
This means that everything that starts with go/ will be discarded by the search engine.
If you want to use other tag beside go/ you can do this without any problems, afterwards be sure to add it in robots.txt. So, for example, if you use something like http://www.domainname.com/recommend/affiliate-name just put:
Disallow: /recommend/
Now just save the file and you are protected, search engines will not follow this links.
So Enjoy Your Earnings.....