Take the 2-minute tour ×

Is there a certain way to check which pages on a website use a specific image?

Say I have some image which I don't use on a page anymore, so I'd like to delete it from my server. But I'm not entirely sure if it's being used on other pages, is there a way to check if it's still being shown on other pages?

share|improve this question
Are your pictures hardcoded in the pages or do they come out of a database? –  putvande Jul 4 '13 at 17:55
The images are hardcoded in the pages. –  Gerb Jul 15 '13 at 12:20

1 Answer 1

up vote 0 down vote accepted

You can hook your website to google webmaster tools and wait a little bit after a while 404 errors will appear there. This way you can track unused resources and dead ends.

This includes images.

There is a better way if you have direct access to the web server.

Visit every page in your website or let google crawl it. You can later sort the files by date modified and ones which are not modified lately are not used.

You have to make sure you get the images from the pages so I would use a historyless cahceless session.

How to sort the files according to the time stamp in unix?

share|improve this answer
I might give this a try. I haven't deleted the images yet, with this method there will be a 'gap' of time where there might be pages that have images that won't show. I guess that is unavoidable? –  Gerb Jul 15 '13 at 12:23
@gerb you are 100% correct. –  raam86 Jul 15 '13 at 12:31
@Gerb updated my answer with a better solution. This also have no latency –  raam86 Jul 15 '13 at 12:41
That worked perfectly for me, thanks! –  Gerb Jul 22 '13 at 6:05

Your Answer


