I do not see a way to get the URL to the full sized image of an attachment.

Yes, i can use get_the_post_thumbnail_url($post->ID, 'full'), but that is of no help if the image is not the featured image.

wp_get_attachment_metadata on my attachment does not show a full size, so therefore wp_get_attachment_image_src($imageID, 'full') returns nothing.

How do I get the full version of an image given the attachment ID?

  • There is no full in sizes, the original is under the key file in the data returned from wp_get_attachment_metadata. Regardless, wp_get_attachment_image_src($imageID, 'full') is correct, and will return an array containing the URL.
    – Milo
    Jul 28, 2017 at 22:35
  • I thought I tested wp_get_attachment_image_url($imageID, 'full') before posting. You are right, to my surprise. I'm not sure why I thought it was failing Jul 29, 2017 at 0:22

2 Answers 2


I solved this using wp_get_attachment_url($imageID);

But, you can also use wp_get_attachment_image_url($imageID, 'full')

  • Jeff that's exactly what i answered you in part 2 of my answer...
    – rudtek
    Jul 29, 2017 at 22:48
  • I wasn't asking about post thumbnails. I was specifically asking about attachments not directly tied to a post. feel free to adjust your answer accordingly.... and i realized I made a mistake when testing wp_get_attachment_image_url() only after @milo pointed it out. Jul 30, 2017 at 16:34

I think you're overthinking the system. Unfortunately the nomenclature isn't helping. The Thumbnail here is the actual image when you use get_the_post_thumbnail_url().

as an example. Say today you uploaded an image called myimage.jpg.

That would go, if you're storing images by date into this directory: /wp-content/uploads/2017/07/myimage.jpg.

Now when you call :

$featured_img_url = get_the_post_thumbnail_url('full');  //(or leave the parameter blank)

echo $featured_img_url;

you would get:


On the other hand if you used this code:

$featured_img_url = get_the_post_thumbnail_url('thumbnail');  //(or choose a different thumbnail size..medium...large...)

echo $featured_img_url;

it would return:


the autogenerated image based on your thumbnail settings.

to avoid the naming confusion you could also try...


but this requires the actual attachment id, not post id, whether or not you're in the loop.

$imgid = 6; //need to get it dynamically
$imgurldesktop = wp_get_attachment_image_url( $imgid, '' ); //use default image size
$imgurlmobile = wp_get_attachment_image_url( $imgid, 'home-slide-img-mobile' ); //use custom set size
  • I am talking about images uploaded via Advanced Custom Fields, and not directly tied to a post. Thats why i'm messing with wp_get_attachment_image_url(), because i know the attachment ID. Jul 29, 2017 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.