Skip to main content
All CollectionsGeneral
How do I remove TinyIMG code from my theme ?
How do I remove TinyIMG code from my theme ?

Remove asset preloading and script control code from the theme.

Julia avatar
Written by Julia
Updated over 9 months ago

TinyIMG adds two types of code to your theme:

  1. Script control code

  2. Asset preloading code

Both features create one liquid file each and add one line of code in your theme.

Before making any changes to a theme, ensure you create a backup of the theme. This backup will be essential in case any changes are made incorrectly and you need to restore quickly.

To remove the script control added by TinyIMG from your theme, follow these steps:

  1. Open your theme.liquid file.

  2. Search for "tinyscript".

  3. Locate the line that resembles the following:

    {%- if tinyscript -%}{{ content_for_header }}{%- else -%}{% render 'tiny-script-control' %}{%- endif -%}

  4. Replace that line with just: {{ content_for_header }}

  5. Save the changes to your theme.liquid file.

After the change It should look like this:

To remove the asset preloading added by TinyIMG from your theme, follow these steps:

  1. Open your theme.liquid file.

  2. Search for "tiny-img-link-preloade".

  3. Locate the line that resembles the following:

    {{'tiny-img-link-preloader.js' | asset_url | script_tag }}

  4. Remove the line entirely.

  5. Save the changes to your theme.liquid file.

Now you can safely remove the 2 remaining files from your theme that tinyimg created:

  1. tiny-script-control.liquid

  2. tiny-img-link-preloader.js

When you open each of the files, you will see a delete button. Click on it to confirm deletion, and those files will be deleted!

Did this answer your question?