Ask a Question ?
Design & Publish Websites Faster

Clean & Indent the Generated Source Code

Are you interested in the HTML code that our editor generates? Do you like to keep your code nice and clean? Then the Optimize Source Code option is for you!

Before enabling this feature, the code output by the editor is extensive and has a lot of inline scripts. When enabled, the code is indented for better readability, and the inline scripts reduced to the minimum, sending the extra code to external files.

How to Enable it

Go to the shelf at the bottom and click on More and select URL & Custom Tracking Code.

More menu on the shelf, highlighting the "URL & Custom Tracking Code" option

Click on this option to open the URL and tracking code preferences

On the panel that opens, check the box for “Optimize Source Code”  right above the custom code section.

URL & custom code settings window

Click on the check box to enable the source code optimization

In order to visualize it, your site must be already published. Then, for it to take effect, you must manually push this update by clicking on the Publish Changes button on the shelf.

Publish changes button

Click on this button to update your published site and generate the “clean” code

Before and After

Want to take a look at how the code is optimized? The following is a “before” optimization screenshot.

The source window without the code optimization option enabled

Source code before optimization

And here’s what it looks once optimized:

The source window with code optimization enabled

Source code after optimization

FAQ

Where do I find the source code?

Every modern browser has an option to visualize the source code of the page you’re currently viewing. It varies from browser to browser, but there’s usually an option under the “View” or “Tools” menu called “View Source”.

"View Source" code in Google Chrome

This is the menu where you’ll find the “view source code” option in Google Chrome

Is it automatically generated?

If it’s the first time you enable it, no, you have to manually click on “Publish Changes” on the shelf to generate the clean code. Once you have this option checked, every time you make and publish changes, your code will be optimized.

Does it have any impact on my site?

It helps with SEO and source code readability. It doesn’t have any negative impact, nor does it slow down the loading of your site.

Something missing? Let us know in the comments!

Menu