How do I remove the colon from my field labels? I simply want to be able to remove the colon from my rendered field labels, for example:

Hotel name:
to
Hotel name

I copied field.tpl.php and removed the colon there, but no matter what Drupal refuses to accept it and is pulling the colon from elsewhere.

How can I do this with a template.php function?
The answer is definitely to use field.tpl.php. If you look at the source for that file you can see the offending lines:

&lt;?php if (!$label_hidden): ?&gt;
  &lt;div class="field-label"&lt;?php print $title_attributes; ?&gt;&gt;
    &lt;?php print $label ?&gt;:&amp;nbsp;
  &lt;/div&gt;
&lt;?php endif; ?&gt;


(spacing and indentation mine for clarity).

Removing the colon is as simple as replacing the above lines with:

&lt;?php if (!$label_hidden): ?&gt;
  &lt;div class="field-label"&lt;?php print $title_attributes; ?&gt;&gt;
    &lt;?php print $label ?&gt;&amp;nbsp;
  &lt;/div&gt;
&lt;?php endif; ?&gt;


I've just tested that on a blank Drupal installation and it works perfectly; no more colons after field labels.

If you're already doing the same thing, but not getting the correct results, then I can think of one or two things that could be going awry:


You've put your custom version of field.tpl.php into a module folder, rather than in your site's active theme folder (it needs to be in the theme folder).
Another module/element in the system is also overriding field.tpl.php, in a more robust manner than you currently are. Seeing if this is the case will involve the always-tedious  disabling of each enabled module to determine where the problem is coming from.


You won't be able to make the change with a template preprocess function, as the colon is hard-coded into the template file.