WordPress: How to link images to files or URLs

July 27, 2010 / Updated: February 1, 2019 / Lena Shore
Filed under: ,

How to link an image with WordPress

You can link images in your wordpress posts or pages to any URL or file. You might want to link to another website or you might want to link to a PDF or other file you have on your site. This short tutorial will show you how to do both.

First, we are going to link an image to another website.

  1. Go to the post or page you’d like to insert a linked image.
  2. Place your cursor and select the “add image” button.
  3. From here we are going to concentrate on the “Link URL” section.
  4. Right now you’ll notice that the link URL area is populated with the absolute path of the image we have chosen. If you choose “none” your image will not link to anything when clicked. If you choose “file URL” it will link to the original image you’ve uploaded in it’s original size. If you select the Post URL, it will link to the post or page that the image located in.
  5. We want this image to link to another website. So, we are going to replace the link with our own.
  6. Copy the URL to the page you want to link to and go back to my “Add an image” area and paste that URL into the “Link URL” area.
  7. Select “insert into post”.
  8. If you click “preview changes” you will see what the page will actually look like and test it to make sure it goes where I want to.

Next, we are going to take the same image and link it to a PDF file.

  1. First we need to upload a PDF.
  2. You can place your cursor anywhere because we aren’t actually going to place it. We just want to upload it to WordPress.
  3. Select the “Add Media” button and find and upload your PDF file the same way you did your image  earlier.
  4. This time, you want to click the “file URL” button. When you do, you’ll see that the link to the file will be populated in the space above. Copy that URL and close the window.
  5. Now, click on the image that you want to link the PDF to and select the “Edit Image” button.
  6. Where the Link URL appears, paste the URL of the PDF that we just copied.
  7. Now, click Update.
  8. Preview the page again to see your changes. When you click the photo it should bring up the PDF that you linked to it.