Streaming live at 10am (PST)

Custom code for entire site


#1

Hi, How does custom code for the entire site work?. If i add custom code in the site settings that affects the entire site, is it copied to individual pages when the site is published or there is a central file that all the pages read it from.

Thanks.


#2

There is not a central file that is read.
- the (same) code is inserted into every page.

Webflow is considering removing this feature.

You can place the code into an individual page...
- so it's not included globally.

The advantage... as stated above
- is that it's not globally inserted

The disadvantage is
- if you need global code... you have copy it everywhere
- and you have to maintain the code everywhere also... which can be a PIA. I've done it.

@webflow ... I would recommend keeping the Global Custom Code feature
- as well as Custom Code for each individual page.

This allow us (the user) to choose what we need.

@cyberdave @PixelGeek @callmevlad @thesergie


#3

+1 for keeping both ... I actively use both global and individual custom code

the sitewide custom code is especially useful when loading external js libraries like the facebook api, swiper, etc...


#4

Yeah the custom code in the site settings (dashboard) is for each page. The custom code in the page settings is only for that page.

Webflow is considering removing this feature.

@Revolution I think you're confusing it with removing the site-wide SEO Meta title and description fields. We removed those because it's poor practice and can hurt SEO (each title/description should be unique for each page). We wouldn't remove site-wide custom code but we will likely move it into the designer instead of it being in the dashboard/site-settings tab.


#5

No. It wasn't the SEO topic. I remember when the SEO discussion was happening.

This topic was less than 2 weeks ago.

I could swear it was @callmevlad who posted the message.

The post asked our thoughts about removing the global custom code feature
- because custom code is now available on each page
- (which wasn't always the case).

I found it odd that the message was in the public. So I didn't respond.

Not 100% certain - but I thought Custom Code on a Page came out about a year ago.


#6

This topic was automatically closed after 60 days. New replies are no longer allowed.