Hunt down broken image URLs within WordPress blog posts
Recently had a need to verify that all internal image references used within the posts of a WordPress blog did in fact link up to a valid image within the wp-content/uploads/
directory.
There were a few thousand posts to validate so, I wrote something small (and rather a hack!) as a PHP script for the task at hand:
https://github.com/magnetikonline/wordpressvalidatepostimgurl
Designed to be run from the shell/CLI, it works over all your published blog posts, extracts image URLs and then validates the referenced image actually does exist on disk under wp-content/uploads/
.
Hope it's of use to someone :)
Written by Peter Mescalchin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#