Remove HTML Comments from wordpress website source
November 3, 2016 Comments 0 115 Views

Remove HTML Comments from wordpress website source

Once you are done creating your WordPress website, have a look at your HTML source code generated by the browser. You may notice many HTML comments added by your theme or plugins to your website source code.

Removing HTML Comments from source code will reduce HTML page size.

The HTML comments help developers to understand things like starting and ending of the HTML sections. Use of JS / CSS description. But it adds additional size to your HTML content and make the page little heavy in size. A good website should not have such comments and the website should be clean from all this type of not required items in HTML source.

Simple code to remove HTML Comments :

Below is a a simple fix where you will add below code into your functions.php file and it will remove all the HTML comments not required from your website source.

Above code will remove HTML comments from your website source code and make the page clean, light weight and remove extra lines occupied by comments.

Previous Tips to Speed Up Your Joomla Website Performance
Next Remove & Clean not required items from Wordpress Head Section.

About author

Rio
Rio 36 posts

Expert web developer working in PHP, Wordpress, Joomla, Magento, Javascript etc.

You might also like

WordPress 0 Comments

Remove & Clean not required items from WordPress Head Section.

If you check the source of your WordPress WebSite then you will see many attributes lines in your wordpress head section. Not all are required items and we always think

WordPress 0 Comments

Remove Emoji Script & CSS from your wordpress source code.

When you install a new wordpress you will find a Emoji Script and CSS in your wordpress source code. Looking at the code you may feel it is unwanted and

WordPress 0 Comments

Boost your wordpress site using htaccess optimization methods

You can optmize your wordpress website using htaccess file techniques. Only enabling the Compression, Setting up Header Expiry, Setting Header Cache controls can do wonders with your page loading speed.

WordPress 0 Comments

Remove category & tag base from WordPress url

WordPress permalinks add category as a base in URL of categories where your URL becomes /category/categoryname/ there is no issue in using this URL. But still many of us need

WordPress 0 Comments

Change admin username in wordpress for security

When you install new wordpress to create your website then the after setup the default admin username created is “admin” unless you specified any different username. This is the main

WordPress 0 Comments

Secure WordPress login with additional Authentication Layer

We can use WordPress for creating a different website having default or custom functionalities. WordPress can be use for creating Blog, CMS, Ecommerce, Community, Social Site, Download Management, Movies Hub