Search Engine Optimization or SEO is important for any blog or website. That's why ThirstyAffiliates provide features to add additional rel tags to your affiliate links so you can control additional attributes about those links.
While we have a dedicated option for “nofollow” that doesn't always stop your links getting indexed in the SERPs these days.
If you want to be sure that your affiliate links have the least chance of getting indexed in the search engine result pages, you need to put a rel=”noindex” to your affiliate links.
There are two options on how to add the “noindex” rel tag:
1. Globally add the “noindex” rel tag
In the ThirstyAffiliates > Settings > Link Appearance, we have a setting called Additional rel attribute tags where you can add the “noindex” rel tag to prevent all of your affiliates links from getting indexed on search engines.
2. Apply “noindex” rel tag to your individual links
Alternatively, there's also the Opciones de enlace located in your individual affiliate link settings. This gives you an option to choose which specific affiliate links you want to add the “noindex” rel tag to.
NOTA: Once this setting is applied, you need to wait a few days for Google/other search engines to recrawl and reindex your site.
It's worth mentioning that you also need to make sure the Googlebot is no blocked so they can crawl your site so they can find the rel=”noindex” tags. Please make sure that you no block it via robots.txt and the Enable Bot Crawl Blocker Script is unchecked on ThirstyAffiliates > Settings > General.
3. Add ‘noindex' to HTTP headers on redirect
Google sometimes will not view rel=”noindex” as a valid way to tell if the page should be shown in their index or not.
La forma más novedosa y fiable de garantizar que sus enlaces de afiliado no se indexen es añadir noindex a las cabeceras de respuesta HTTP durante el redireccionamiento.
Este fragmento de código hará el trabajo:
function ta_add_noindex_headers() {
header( 'X-Robots-Tag: noindex, nofollow' );
}
add_action( 'ta_before_link_redirect' , 'ta_add_noindex_headers' );
Necesitas añadir este fragmento a tu functions.php o en un plugin drop in.
En el futuro, añadiremos esta función a nuestro plugin.