wagtailwagtail-admin

Re-populate Image "Usage" references in Wagtail Admin?


Image usage field

Hi, I recently upgraded Wagtail from v2 to v4 and noticed they added a new metafield called image usage in Wagtail Admin. But the issue is that all images referenced before the upgrade say they are used 0 times. It seems like the db table is empty as well. Is there any way to re-populate them?

As far as I know, the docs on the image field doesn't go over this feature. Thanks in advance!


Solution

  • From the Wagtail 4.1 release notes about this feature:

    After upgrading, you will need to run ./manage.py rebuild_references_index in order to populate the references table and ensure that usage counts for images, documents and snippets are displayed accurately.