Finding unused Image Styles I'm working on a pre-existing Drupal 7 website that has been through several iterations so I'm trying to have a tidy up and remove items which are not required.

I'm currently looking at the Image Styles, of which there are 26 on the site. I'm pretty sure a lot are not used any more, is there any best practise method of making sure they're not used before removing them? My current thinking is either to check every Content Type &amp; View to see if they're used, then do a search in the database &amp; code base to see if they appear in there. Is this the best way? Would it cover all locations they could be being used?
You have a couple of tasks,


Identify all the image styles
Identify where they're used. You can have multiple node displays, views, display suite, panels, etc.
Check if they're defined in code (features/custom modules)
Remove extra ones that aren't being used


They all apply to images. So your first step if find image fields and where they're used. Drupal has a report for that.

admin/reports/fields


For Views, you can use, 

admin/reports/fields/views-fields


For each content type, check all displays see which ones are used,

admin/structure/types/manage/&lt;CONTENT_TYPE&gt;/display
admin/structure/types/manage/&lt;CONTENT_TYPE&gt;/display/teaser
admin/structure/types/manage/&lt;CONTENT_TYPE&gt;/display/&lt;OTHER_DISPLAYS&gt;


Then see if you have Panels or Display Suite. And check those modules to see if they reference other image styles.

After that, you can start looking into your code. This could be tricky. Assuming the contrib modules are in a separate folder,

sites/all/modules/contrib


It's easy,

grep -rn 'image_format_machine_name' sites/all/modules | grep -v 'contrib'


But if everything is thrown together into modules/, contributed, custom, feature modules, you'll have to exclude contributed modules manually. Probably Excel would be your best bet here.

I think basically that should cover the places where they're used. 

Not sure if anyone would have any other ideas.