In order to change an image’s caption, you can of course find that image in the WordPress Media Gallery and enter a new value in the “Caption” field, but what if you want to update the captions of 100 images? It’d be much more efficient to write some code to handle that for you.

As an example, here’s how you would set the captions of a few images to be the same as the image title:

1 comment

  1. sandip June 6, 2017 at 3:41 am

    Reply

    it working great
    thank you.

Leave a reply

Your email address will not be published. Required fields are marked *