> For the complete documentation index, see [llms.txt](https://docs.shoplift.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoplift.ai/account/account-preferences/auto-restore-missing-templates.md).

# Auto-Restore Missing Templates

Auto-restore missing templates keeps your active [template tests](/test/template-testing.md) and [theme tests](/test/theme-testing.md) running when files they depend on go missing from your theme. Instead of pausing a test the moment something in your theme changes, Shoplift tries to put the missing files back automatically.

This setting is now **on by default** for all stores. You don't need to set anything up. If you'd rather manage your theme files yourself, you can turn it off at any time.

{% hint style="info" %}
Most merchants don't need to do anything. Auto-restore runs quietly in the background and only steps in when a test would otherwise break.
{% endhint %}

### Why tests break when files go missing

A test depends on specific files being present in your theme. When one of those files disappears, the test can't run correctly, and Shoplift may pause it to keep your results clean.

The most common cause is publishing a new or updated theme. A fresh theme won't include the extra files Shoplift added for your test, so those files effectively vanish the moment you publish.

Auto-restore is built to catch these situations and fix them before your test is interrupted.

### How it works

Shoplift backs up the theme files each active test needs. If one of those files goes missing while the test is running, Shoplift restores it from the backup. This happens in two situations.

#### Template tests

When you launch a template test, Shoplift creates a copy of your template for the variant (the changed version some visitors see). If that copy goes missing during the test; for example, because you published a new theme that doesn't include it, Shoplift restores it from the backup taken when the test launched. Your test keeps running without a gap.

#### Theme tests

A theme test compares your live theme (your "main theme") against a separate test theme. If the test starts to depend on new files partway through, such as when you publish a new page builder page that adds a template or snippet, Shoplift copies the missing files from your main theme into the test theme. This keeps the test from being interrupted.

{% hint style="info" %}
**For developers:** Shoplift adds variant template files with an `sl-` suffix (for example, `product.sl-ABC123.json`). These are the files most often lost when a theme is republished, and they're the ones auto-restore is designed to recover.
{% endhint %}

### Tests can still pause

Auto-restore handles the most common file problems, but it can't fix everything. If a test hits an issue it can't resolve on its own, Shoplift will still pause the test to protect your results. You'll see the paused test in your dashboard along with the reason, so you can fix the issue and resume.

### Risks and limitations

Auto-restore is safe for template tests. For theme tests, there's one small risk worth knowing about.

When Shoplift copies files from your main theme into your test theme, and your test theme already has its own references to files with those same names, the copied files could behave in unexpected ways. Whether this happens depends on how your themes are set up. It hasn't caused problems in practice, but it's useful context if a theme test starts behaving strangely after you publish a theme.

{% hint style="warning" %}
If you work with a developer, it's worth letting them know this setting is on, especially if your theme tests use heavily customized or page-builder-based themes.
{% endhint %}

### Turn auto-restore off

You stay in control. You can disable auto-restore whenever you want.

1. In Shoplift, go to **Settings > Preferences**.
2. Find **Auto-restore missing templates**.
3. Toggle it off.&#x20;

You can turn it back on from the same place at any time.

***

#### Still need help?

If a test paused and you're not sure why, or auto-restore didn't behave as expected, please reach out to Shoplift support at <help@shoplift.ai>.
