Streaming live at 10am (PST)

Custom Code Character Limit *WORKAROUND*

As you may or may not know, Webflow has a character limit on the custom code block. This can cause issue with SVG’s, or larger HTML that exceeds this limit.

But there is a workaround.

Just follow these steps:

  1. Make a GitHub account
  2. Make a new repository (call it whatever you like) and make it public
  3. Choose ‘create new file’

  1. Copy your HTML and then paste the code into the new file.
  2. Name your file and add the extension .html (for example [repositoryname]/mycode.html)
  3. Click ‘commit new file’
  4. In your repository, open your file, and then click ‘raw’

  1. Copy the URL of the RAW format, it should, look like this:

https://raw.githubusercontent.com/username/respositoryname/master/filename.html

  1. Go back to your Webflow page where you require the HTML and add a custom code block.
  2. Add the following code to your custom code block:

<div id="ajaxContent"></div><script> var Webflow = Webflow || []; Webflow.push(function() { $.get('YOUR COPIED LINK HERE', function(data) { $('#ajaxContent').append(data); }); }); </script>

  1. Paste your copied RAW url into the ‘YOUR COPIED LINK HERE’ section, and then press save.
  2. Publish your website and test.

I hope this helps! It’s saved me a few times, so I figured I should share it.

4 Likes