Google sometimes doesn't view rel=”noindex” as a valid way to tell if the page should be shown in their index or not.
The newest and most reliable way to ensure that your affiliate links are not indexed is by adding noindex to the HTTP response headers during redirection.
This snippet of code will do the job:
function ta_add_noindex_headers() {
header( 'X-Robots-Tag: noindex, nofollow' );
}
add_action( 'ta_before_link_redirect' , 'ta_add_noindex_headers' );
You need to add this snippet to your functions.php or in a drop in plugin.
In future, we will add this as a feature to our plugin.