WordPress Developer Ukraine, Kyiv
Get Image Alt Text and Title from a URL in WordPress

Get Image Alt Text and Title from a URL in WordPress

When a theme or page builder stores an image as a plain URL (e.g. in a theme options field or an ACF text field), you lose access to the attachment’s alt text and title stored in the Media Library. The functions below let you look up an attachment by its URL and retrieve those attributes…