Home App Docs Blog Github

Error when publishing to Shopify: Template content exceeds 256kb

While Builder is super flexible, we still need to abide by the rules set by Shopify with regards to themes and templates. One of those requirements is that template files in themes are less than 256kb in size. When building a page you might exceed that limit in a few ways, but in general it is probably because there are too many elements on the page or you are using big chunks of code in custom code blocks.

One common reason this comes up is using large svgs in custom code blocks. To get around this situation, you can minify the svgs using a tool like SVGOMG - SVGO's Missing GUI. Or, if possible, use a jpg or png in an image block instead of svgs in custom code blocks. Using an uploaded image versus an svg saves template space because the actual image is not stored in the template file, unlike in the case of an svg.

Another possible reason this error occurs is having too many A/B test variations of the page in Builder. If you done with a test or are not sending any traffic to some of the variations, remove them so they don’t count towards the file size limit.

1 Like