How to remove the "Add Product Tags" option from the frontend of Magento

By default, product tags can be added not only by administrators from the backend of Magento but also by registered customers from the frontend of the site. This can be done from the details/view page of each product. Under the description of the product there's a section called Product Tags that lists all tags that have been added to the product, and that also contains a text field and an Add Tags button that can be used by customers to add tags to the particular product.

If you want to, you can remove the whole Product Tags section from all product details pages. Alternatively, you can disable just the function (by removing the field for typing the tags and the button for adding them) so that customers won't be able to add tags but will still be able to see and use the tags that are currently associated with the product.

To remove the whole tags section from product details pages you need to modify the styles.css file of the theme that you use. If, for example, you use the default base theme that comes prepackaged with Magento, and your store is installed directly in the public_html folder on your Magento hosting account, then the path to the file on your account will be public_html/skin/frontend/default/default/css/styles.css. Edit the file by adding the following line:

.box-tags {display:none;}

You can do that from the Files section of the Pixie control panel, or you can download the file with an FTP client (e.g. FileZilla), make the change with a text editor (e.g. Notepad, Wordpad), and upload it back overwriting the old file. The change will remove from the view page of each product both the option that allows customers to add tags and the list of tags that are associated with the product.

If you want tags that are already added to a product to be shown on product details pages, and you want tags that will be added in the future by administrators from the backend also to be shown on product details pages, but you don't want the option for adding tags to be visible on those pages, you can remove it by modifying a template file called list.phtml. If you use the default theme prepackaged with Magento and your Magento root directory is public_html, the path to the file will be public_html/app/design/frontend/base/default/template/tag/list.phtml. You need to comment out the following string of code:

<form id="addTagForm" action="<?php echo $this->getFormAction(); ?>" method="get">
  <div class="form-add">
   <label for="productTagName"><?php echo $this->__('Add Your Tags:') ?></label>
    <div class="input-box">
     <input type="text" class="input-text required-entry" 
name="productTagName" id="productTagName" />
     <button type="button" title="<?php echo $this->__('Add Tags') ?>" 
class="button" onclick="submitTagForm()">
       <span><?php echo $this->__('Add Tags') ?></span>
<p class="note"><?php echo $this->__("Use spaces to separate tags. 
Use single quotes (') for phrases.") ?></p>

To comment it out put an exclamation mark and two hyphens after the first bracket (e.g. <!--form) and two hyphens before the last bracket (e.g. /p-->).

After you're done with the modifications flush the Magento cache and your browser's cache and refresh the frontend of your site to see the results.

Note that such modifications are overwritten when you upgrade Magento (or the particular theme) so you have to keep track of all code changes. A better solution is to create a subtheme and make the changes to the files of the subtheme. For more information on this read the article on creating a subtheme in Magento.

Was this answer helpful?

 Print this Article

Also Read