<blockquote>
  <p>is there a way to check the site for missing file links, including those in redactor?</p>
</blockquote>

<p>I can't think of a way to do this outside of writing a custom plugin/PHP script that loaded everywhere an Asset field might exist on an install, grabbed its contents and verified them against the file system.</p>

<p>Additionally, it would have to load any Rich Text field you have setup with Asset sources, use some regex to match any Assets reference tags it might contain and do a similar file system verification to check for the existence of the images.</p>

<blockquote>
  <p>Also is there any strategy for preventing clients from removing used assets?</p>
</blockquote>

<p>Take away their "Remove Files" permission from the Asset source under their user/user group permissions.</p>

CC BY-SA 3.0
2016-07-05T07:10:56.980Z
Thanks Brad. Could seeing which images are "attached" be a future request or is this unachievable?
noregt
CC BY-SA 3.0
2016-07-05T21:15:22.887Z
You could add it to feedback.craftcms.com, but it definitely feels like more plugin territory to me.
Brad Bell
CC BY-SA 3.0
2016-07-04T22:18:17.400Z
2016-07-04T22:18:17.400Z
Brad Bell
<p>A client removed a lot of files in a moment of clarity, not realizing these were used in pages (thinking since they were used in those pages, they were no longer necessary in the assets system).</p>

<p>Before I completely reset the site to a few weeks ago (that was the time before they realized); is there a way to check the site for missing file links, including those in redactor?</p>

<p>Also is there any strategy for preventing clients from removing used assets? In WP for instance you can see which images are "attached". This is not waterproof, but still. </p>

<assets><files><link>
Check the site for missing file links / warn user before removing used files
# Check the site for missing file links / warn user before removing used files

(Asked by: username_0 on 2016-07-04)

A client removed a lot of files in a moment of clarity, not realizing these were used in pages (thinking since they were used in those pages, they were no longer necessary in the assets system).

Before I completely reset the site to a few weeks ago (that was the time before they realized); is there a way to check the site for missing file links, including those in redactor?

Also is there any strategy for preventing clients from removing used assets? In WP for instance you can see which images are "attached". This is not waterproof, but still.

**Tags:** assets, files, link


---

## 1 answers

### Answer by username_1 on 2016-07-04. Score: 2

> is there a way to check the site for missing file links, including those in redactor?

I can't think of a way to do this outside of writing a custom plugin/PHP script that loaded everywhere an Asset field might exist on an install, grabbed its contents and verified them against the file system.

Additionally, it would have to load any Rich Text field you have setup with Asset sources, use some regex to match any Assets reference tags it might contain and do a similar file system verification to check for the existence of the images.

> Also is there any strategy for preventing clients from removing used assets?

Take away their "Remove Files" permission from the Asset source under their user/user group permissions.

> **Comments:**
> **username_0**: Thanks Brad. Could seeing which images are "attached" be a future request or is this unachievable?  
> **username_1**: You could add it to feedback.craftcms.com, but it definitely feels like more plugin territory to me.  

---

