If you’re like me, you’ve probably wondered why WordPress creates by default a link to any image you insert into a post or page. Why would we want to remove links from post images? Read on for the answer.
What’s So Bad about Post Image Links?
What happens when you click that link? You get a page with nothing but the image on it that replaces the page you were reading. You have to know to click the Back arrow in your browser in order to get back to the page you were reading. How many readers do you suppose get lost or annoyed because they clicked the image link and just go off somewhere else rather than take the trouble to get back to your page? You think that might have a negative effect on your bounce rate?
Certainly there are valid reasons to have a link in a post image. You might want to link to a download or reference another site, for example. In my experience, those cases are in the minority. If you do want a link on an image, you also want to direct that link to open in a new tab or window so that visitors don’t surf off to the new location and forget that your site is where they came from.
In my opinion, no link should be the default, but nobody asked me. So, with that in mind, here’s how to remove the default link from a post image.
Before Inserting the Image
If you’re inserting an image into a post, the media library dialog has three buttons under the link field, one of which is “None”. Simply click that button to clear the link field before you insert the image as shown below:
After you click the None button, the link field will be empty as shown here:
Click the Insert into Post button to insert the image without a link.
If you’ve already got images in existing posts, and you feel like taking the time to get rid of the links, you can edit the posts in visual mode and unlink the images as shown below:
Be sure your editor is in Visual mode. Click the image to highlight it. The Link and Unlink buttons in the toolbar will show as active. Note the Path shown in the lower left of the editor has an “a >” tag, which is the link tag. Click the Unlink button in the toolbar. The result is shown below:
Note that the Link and Unlink buttons are now grayed out and the “a >” is gone from the Path in the lower left of the editor.
If you’re really hard core you can edit the post in HTML mode and remove the hyperlink tags that way. Whatever floats your boat!
But, I Want A Link!
If you really want a link on your post image, let’s say to a related site, it’s easy to create one. Simply enter the URL into the link field while you’re inserting the image as shown below:
The problem is that you’ll still have the issue of the download page opening in the same window as the original post. Once again, Visual mode to the rescue! Select the image you just inserted as shown below:
Note that the Link and Unlink buttons are active. Click the Link button to edit the existing link. In the resulting dialog, shown below, check the box to open in a new window/tab:
Click the Update button and your image link will now open in a new window or tab.
Again, you can go into Geek Mode, if you’re so inclined, and edit the HTML directly by adding a “target=’_blank'” parameter to the hyperlink tag.
Feel free to ask any questions by leaving a comment below.