What does "Liquid error: invalid url input" mean in Shopify?
It means a line in your theme asked Shopify for an image URL and gave it nothing to work with. The image_url filter needs a real Shopify image, and when it gets an empty image setting, a collection or product with no picture, or a web address typed as text, Shopify prints Liquid error (sections/hero line 4): invalid url input on the page where the picture should be.
The quick fix is to give it the image: upload a picture to the empty setting in the theme editor, or add an image to the collection the section shows. The lasting fix is a check in the code so an empty image shows a placeholder instead of an error. Both are below, along with what Shopify printed for each of 28 image cases we ran on a development store on 23 October 2026.
How do I find which image is causing it?
Read the text in brackets. The error names the file and the line, without the .liquid ending. sections/probe line 1 means line 1 of sections/probe.liquid; templates/index line 23 means line 23 of the homepage template. Then match the line to one of these:
| What the line is reading | Why it is empty | Fix without code |
|---|---|---|
section.settings.image or block.settings.image | Nobody picked an image for that section or block yet, common right after installing a theme | Theme editor: click the section, choose Select image, save |
settings.logo or another global setting | The Theme settings image was never uploaded | Theme editor, Theme settings (the gear icon), upload the file |
collection.image | The collection has no collection image of its own | Shopify admin, Products, Collections, open it, add an image |
product.featured_image or article.image | That product or blog post has no image | Add one in the product or blog post editor |
| A setting or metafield holding a web address as text | image_url only accepts Shopify images, never a typed URL | Upload the picture to Shopify instead, or have the code use the address directly |
A metafield like product.metafields.custom.banner | The metafield is empty for this product, or does not exist | Fill in the metafield on the product, or check its namespace and key |
If you cannot tell which it is from the editor, open Online Store, Themes, the three dots, Edit code, open the named file and go to the line number. The word straight before | image_url is the thing that is empty.
What did Shopify print when we tested it?
We ran a test theme on a Shopify development store with Shopify CLI 3.93.1 on 23 October 2026, put each image case on the homepage, read the rendered HTML, and deleted the theme afterwards. Every product on that store has a photo, so the empty product case was tested with an empty value; the empty collection rows are the real world version of the same thing.
What the theme passed to image_url | What Shopify rendered |
|---|---|
An empty image_picker section setting | Liquid error (sections/probe line 1): invalid url input |
The same, piped on into image_tag | The same error, and no <img> tag at all |
| An empty Theme settings logo | invalid url input |
| An empty value, or an empty string | invalid url input |
'https://example.com/photo.jpg', typed directly or saved in a text setting | invalid url input |
A file name as text, 'missing-file.jpg' | invalid url input |
| A product metafield that does not exist | invalid url input |
collection.image on 3 collections, none with an uploaded image | invalid url input, 3 times |
collection.featured_image on the same 3 | 2 real image URLs (Shopify fell back to a product photo) and 1 error, on the empty Home page collection |
| A real product image | /cdn/shop/files/Main.jpg?v=...&width=600 |
| The product object itself rather than its image | Worked: the URL of the product's first image |
A real image with width: 6000 | No error: quietly reduced to width=5760 |
A real image with width: 0 | Liquid error (templates/index line 29): Width must be between 1 and 5760 |
An empty setting with the older img_url filter | No error: a grey Shopify "no image" GIF, no-image-2048-a2addb12_800x.gif |
An empty setting checked with if ... != blank first, placeholder_svg_tag otherwise | No error: a placeholder drawing |
Three things in that table matter. First, the error replaces only the one image. The text, the rest of the section and the rest of the page all rendered, so on a live store it looks like one odd line of text, not a broken store. Second, collection.image and collection.featured_image are not the same thing: the first is only the image you uploaded to the collection, the second falls back to a product photo, and only an empty collection breaks both. Third, the older filter hides the problem rather than fixing it, which is why a theme can switch from img_url to image_url and suddenly show errors that were grey boxes before.
How do I fix it in the theme code?
Check the image before asking for its URL, and render something else when it is empty. This is the pattern that rendered cleanly in our test:
{%- if section.settings.image != blank -%}
{{ section.settings.image | image_url: width: 1200 | image_tag: loading: 'lazy' }}
{%- else -%}
{{ 'image' | placeholder_svg_tag: 'placeholder' }}
{%- endif -%}
For a collection, prefer the fallback Shopify already gives you:
{%- assign pic = collection.image | default: collection.featured_image -%}
{%- if pic != blank -%}
{{ pic | image_url: width: 600 | image_tag }}
{%- endif -%}
A few rules that follow from the test:
- Guard the value, not the output. Wrapping the
image_tagin a check does nothing onceimage_urlhas already failed. Theifhas to test the image itself. - Do not swap back to
img_urlto silence it. Shopify listsimg_urlas deprecated, and the grey GIF it returns is still an empty picture, just a quieter one. - Keep widths between 1 and 5760. Above that Shopify reduces the number without telling you; at 0 it prints a different error,
Width must be between 1 and 5760, usually because a range setting was blank or a calculation came out at zero.
Can I use an image from another website with image_url?
No. In our test a full https:// address failed the same way an empty setting did, whether it was typed into the code or saved in a text setting. image_url only works on images Shopify hosts: files you uploaded, product and collection images, and image settings. To use an outside picture, upload it to Content, Files in the Shopify admin and pick it in an image setting, or have the theme write the address straight into an <img src> without the filter. The file_url filter is not a check either: given a file name that does not exist, it still returned a normal looking URL, which then 404s in the browser.
Why did this error appear after I changed or updated my theme?
Usually because the new theme expects images the old one did not. Section and block image settings start empty on a fresh install, and a well built theme shows a placeholder until you fill them. A theme that skips the check shows this error instead, once per empty image. The second common cause is a theme update that moved from img_url to image_url, which turns quiet grey boxes into visible errors. Your products and images are not lost in either case; the section is reading a setting that has not been filled in on this theme yet. If you edited the old theme's code, what happens to your edits when a theme updates explains what carries over.
Where these results come from
Every rendered value and error message above comes from one test theme with 28 image cases, run on a Shopify development store on 23 October 2026 with Shopify CLI 3.93.1 and deleted afterwards. The store had 13 products, all with photos; the 3 collections we checked had no uploaded image, and one of them, Home page, had no product photos to fall back on. The img_url deprecation is from Shopify's Liquid filter reference.
If the space is empty with no error text at all, it is a different fault, covered in why there is blank space around Shopify images. If whole sections are missing, see why a Shopify homepage is blank after installing a theme. And if the error came up while pushing a theme rather than on the storefront, what "default can't be blank" means covers the schema side.
Frequently asked questions
What does "Liquid error: invalid url input" mean in Shopify?
A line in the theme passed nothing usable to the image_url filter: an empty image setting, a collection or product with no image, an empty metafield, or a web address typed as text. Shopify prints the error, with the file and line number, where the image should be.
How do I fix invalid url input without editing code?
Fill in the image the line is reading. Usually that means selecting an image for the section or block in the theme editor, uploading a logo in Theme settings, or adding a collection image in Products, Collections. The file name in the error tells you which section to open.
How do I stop invalid url input in my theme code?
Check the image before calling image_url: wrap it in {% if section.settings.image != blank %} and render placeholder_svg_tag in the else branch. In our test that rendered a placeholder drawing with no error. Checking the image_tag output instead does not help, because image_url has already failed.
Can customers see the Liquid error on my store?
Yes. It renders as plain text in the page where the image should be. In our test only that one image was replaced: the rest of the section and the page still rendered, so it looks like a stray line of text rather than a broken store.
Can I use an external image URL with image_url in Shopify?
No. In our 23 October 2026 test, a full https address failed with invalid url input whether it was typed in the code or saved in a text setting. Upload the picture to Content, Files and pick it in an image setting, or put the address straight into an img src without the filter.
Why did invalid url input start after a theme update?
Often because the theme moved from the deprecated img_url filter to image_url. On an empty image, img_url returned a grey Shopify no image GIF in our test, while image_url prints the error. The image was missing before too; the new filter just shows it.
What does "Width must be between 1 and 5760" mean?
The image_url filter was given a width of 0, usually from a blank range setting or a calculation that came out at zero. Widths above 5760 do not error: in our test width 6000 was quietly reduced to 5760.
Why does collection.image fail when the collection page shows a picture?
collection.image is only the image uploaded to the collection itself. The picture you see is often collection.featured_image, which falls back to a product photo. In our test 3 collections without uploaded images all failed on collection.image, and 2 of them worked on featured_image.
Generate a theme that looks like your brand
A complete Shopify 2.0 theme with conversion features built in, ready in minutes. No credit card required.
Generate my theme freeNo Shopify store yet? Start one here, then bring the theme. Themr may earn a commission if you start a paid plan; it does not change what you pay.