Skip to content

Choose which cookie categories to allow.

CICO Media
Find image usage

How to Find Images Used in ACF Fields (Image, Gallery, Repeater)

An image used in an ACF field often shows as Unattached in the Media Library. Here is how to find it by hand, in post meta, and how CICO Media Pro lists it with the field name.

By CICO Media4 min read

On this page

You use the same photo in an ACF Image field on a landing page. In the Media Library it says Unattached, and the Uploaded to column is empty. Nothing in WordPress tells you the page uses it. This article shows where ACF keeps the reference, how to find it by hand, and how to shorten the check.

The short answer

ACF saves the attachment ID in the post meta of the post that owns the field. It does not set a parent on the image, so the Media Library cannot show it. To find the post, look for the image ID in the postmeta table.

What ACF stores for each field

  • Image field. One value: the attachment ID, saved in a meta key with the field name.
  • Gallery field. A serialized list of attachment IDs in one meta value. The ID appears inside that text, so an exact match on the value does not find it.
  • Repeater field. One meta row per sub-field and per row, with generated keys such as team_0_photo, team_1_photo. A second row, starting with an underscore, links each one to its field definition.
  • Options pages. Values for an ACF options page live in the options table, not in a post.

The return format you pick in the field settings (image array, URL or ID) changes what your theme receives. It does not change what is saved.

How to find the image by hand

Work on a staging copy if you can, and take a backup first. You need the image ID: open the image in the Media Library. The address bar shows it as item=123 in the grid view, or as post=123 on the edit screen.

  1. Find the image ID. For example, 123.

  2. Search the post meta for the ID. Replace wp_ with your table prefix and 123 with the image ID.

    SELECT post_id, meta_key
    FROM wp_postmeta
    WHERE meta_value = '123'
       OR meta_value LIKE '%"123"%'
       OR meta_value LIKE '%i:123;%';

    The first line matches Image fields. The other two look inside Gallery lists, where the ID is stored as text or as a number.

  3. Read the keys. A key like hero_image is a field you recognise. A key that starts with an underscore is ACF’s companion row, so ignore it. Other numeric meta (a price, a count) can match by accident, so check the key before you trust a row.

  4. Look in the options table for options pages.

    SELECT option_name
    FROM wp_options
    WHERE option_name LIKE 'options\_%' AND option_value = '123';
  5. Open the posts you found and look at the field in the editor.

An image used through an ACF field: the panel names the page, the source and the field group.

How CICO Media Pro shortens the check

This is a Pro source. The free CICO Media reads post content, blocks and featured images, so an image used only in an ACF field shows No usage there, and the Usage tab lists this source as active and not read. CICO Media Pro reads it.

CICO Media Pro keeps a usage index in the background. For ACF it reads Image and Gallery fields, including the ones nested in Repeater, Group and Flexible Content fields. The image card shows Used · N, and the Where used panel lists each place: the owning post, the source (ACF), the real field label and the field group, with a link to edit it.

You can also filter the library by source. Open the CICO Filters bar, choose ACF in All sources, and see the images that come from ACF fields.

Two things to keep in mind:

  • The frontend status is often Unknown. Your theme decides whether to print an ACF field, so CICO says the reference exists and that it cannot verify the page. We explain the three states in Used vs Visible.
  • No usage found means nothing was found. It is not a promise that an image is safe to delete. CICO never deletes anything for you.

If you installed ACF after the first scan, rebuild the index to include existing content straight away.

In the docs: what CICO Media detects in Integrations, and how to rebuild the index.

Summary

Frequently asked questions

How do I find which post uses an image in an ACF field?

ACF saves the image ID in the post meta of the post that owns the field. Search the postmeta table for the ID, for a Gallery inside the serialized list, and open the posts you find. A plugin that keeps a usage index can show the same result without queries.

Why does the Media Library say Unattached for an image in an ACF field?

Unattached means WordPress has no parent post recorded for the image. Choosing an existing image in an ACF field only saves its ID in the post meta. It never sets a parent, so the label stays.

Does ACF store the image ID or the URL?

An Image or Gallery field stores the attachment ID in the post meta. The return format you choose in the field settings only changes what your theme receives when it reads the field.

Does CICO Media Pro find images inside a Repeater?

Yes. CICO Media Pro reads ACF Image and Gallery fields, including the ones nested in Repeater, Group and Flexible Content fields, and shows the field label and the owning post. Very deep or very large field trees can be only partly read, so treat No usage found as a prompt to check.

Can an image in an ACF field show as not used?

It can, if the image is stored in a way the tool does not read, for example in a text field, a custom table or theme code. No tool finds every possible reference, so back up and delete in small batches.

Get CICO Media Pro