How to remove extra white spaces and line breaks from HTML in drupal 7 I am using drupal 7 and created my custom theme. Now I am facing problem that page is containing extra line breaks and while spaces when I open view source.

Can some one suggest any module/code snippet which minimize my html so that page render fast.

Else tell me where I can minimize it in my template.php file or any .tpl file.
Agree with rooby, whitespace in html does not slow down the site performance.

You can use the Minify module to remove extra line breaks and whitespace before and after HTML tag. 

Minify also minimize the JavaScript files. Minimized JavaScript files are smaller in size as compare to regular JavaScript files. Smaller size will helps you to load site faster.

To use Minify


Download and install minify module
Go to performace
Select minify HTML
To minify JavaScript files select Minify JavaScript files in upper right corner