+91-080-41645181 Request a Quote


Is your product description or short description spaced out in magento even though you haven’t added any line breaks? It happens because magento adds automatic line breaks into the content description and short description area using the PHP’s nl2br function.

To get rid of this extra line spacing, you can update the PHP echo statement in your template’s view.phtml and / or description.phtml depending on how your template is designed:

e.g. under app/design/frontend/<your-package>/<your-theme>/template/catalog/product/view.phtml

You can notice the use of nl2br function above in the second echo statement. So just remove that function. The above code should look like this:

Just follow the same steps to remove nl2br function for the main product description if required. If your website is picking the detailed product description from the default magento’s theme then you will not be required to do this as nl2br is already removed in latest versions of magento (starting Magento 1.4.1).

Press Esc to close