Lately, I've noticed an interesting situation related to my Drupal site. When I enter the name of my site in Google's search engine, a list is retrieved with my site maintaining the first position in search results. When I click the link that says "See more results from .com," it lists my Home page first followed by links to three Taxonomy pages.


When I click the pagination links at the bottom of those taxonomy pages, I am taken to the following link locations :


I have nodewords installed to control metatags. I have set the NOINDEX and NOFOLLOW metatags for all taxonomy terms (and for taxonomy itself).

I don't mind using CSS to hide taxonomy terms. I use the taxonomy terms to determine which category to highlight via CSS by using jQuery's addClass/removeClass functions. I need to remove the link surrounding the taxonomy term so that it's not indexed in search engine results. Using jQuery to remove this link is ineffective and the results remain in search engine results. It's my understanding that there is a way to remove the link using the template.php file and the template_preprocess_node(&$vars, $hook) function.

I don't know how to go about doing this. All help is very much appreciated.

  • I came up with a quick fix. I only want to use this fix temporarily until I can come up with the solution that's done the Drupal way. In my node-product.tpl.php file, I made the following changes: $terms = trim(strip_tags($terms)); print $terms;
    – dqfan2012
    Jul 25 '12 at 15:54

In the Manage Display page of your content-type i.e.: admin/structure/types/manage/product/display you should be able to set the output format for your terms to 'plain text'.


You can wild-card the taxonomy pages in robots.txt to prevent google from crawling those pages.

More info

  • I already edited/changed the robots.txt to prevent those pages from being crawled. I also created a permanent redirect in the apache configuration to be sure these pages get no access. I still want remove the link in the way described above using the template.php file and template_preprocess_node() function.
    – dqfan2012
    Jul 25 '12 at 16:46

I would suggest Display Suite module or some jQuery

jQuery(".taxonomy-term h2 a").each(function(){
var $t = jQuery(this);

Thanks @Will and @Matt for this elegant solution.

  • I also suggest to use Display Suite module. But jQuery is not useful if the purpose is to disallow the indexing on search engine.
    – FiNeX
    Jan 8 '14 at 15:10
  • Of course, that was not my case.
    – warmth
    Jan 8 '14 at 15:57

In your template.php file try to do a print_r($vars). It is an array containing all the theme variables. The terms could be in $vars['terms']. Simple set $vars['terms'] = NULL or unset that array element. You could remove the variable in the page template files too.

  • $vars->terms this method is more usefull
    – monymirza
    Dec 30 '12 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.