Alas, as I mentioned in a recent post, WordPress does not provide a simple, direct option for a website to open a sidebar widget graphic/image in a new browser window. Why should you care? Well, if you are a blogger and/or a self-published author displaying book covers on your website with links to your Amazon sale pages (or any other site), listen up.
As a rule, web developers (that’s you!) should ideally set up every link that takes a viewer away from their site to “open in a new browser window.” This rule includes every blog post link. Yes, it does take a bit longer, but if you display them this way your readers will never, ever mistakenly close the browser window when they’re following a link and leave your website for good.
Note that if a visitor is on your website for the first time and has not bookmarked your site, they will often simply not return. That means you’ve lost a potential subscriber. Maybe a book sale or two.
You just don’t want that to happen.
Let’s go back to book cover images. If you know html or have a web developer who maintains your site, you/they can code images to open in a new browser window. But chances are good that if you knew how to do that, you probably would not be reading this post.
So! Let’s say you are permanently displaying images in your sidebar via a widget (like my book covers and Twitter icon to the left of this post), and you want them to link to another page. Because that link is taking your visitor away from your website, you want the new page they’ll be seeing to open in its own browser window.
Well, I’ve learned a pretty simple workaround to make the links function the way you want them to. Here’s how in a few easy steps:
- Create a draft post: Login to your website admin panel and click on Posts > “Add New” from your WordPress dashboard on the left. Create a new post and save it as a draft.
- Place the image in the post: Choose Media > Library from your WordPress dashboard, or click the “Add Media” button just above your blog post menu, also on the left side. Upload and place the image you want to link to in the body of that draft post and choose “align left” to pull the image to the left side of the screen for easiest access.
- Link the image to the destination URL: Hold down your left mouse button, then run the mouse over the image to highlight it. (Do NOT right click and “select” the image.) Next, click the “link” icon from the menu at top. When the pop-up “Enter the destination URL” appears, paste the URL you want the image to link to in the URL window. This is the most important part! In that same pop-up, click inside the box to the left of the words,“Open link in a new window/tab.”
- Switch to Text mode: You are probably working in “Visual” publication mode. (If you see the image, you’re in Visual mode.) You will now need to toggle to the Text editor by choosing the “Text” tab at the upper right of your post menu. While in you’re in Text mode, highlight and copy ALL of the html code that appears on that page. (Not sure how to get there? Notice the gray tabs to the right just above the blog post publication menu? They say “Visual” and “Text.” Click on the word “Text” and you will see a paragraph or so of writing.)
- Place the html code in a Text Widget: Go to your Widgets section. (Choose Appearance > Widgets on the left-side WP dashboard menu.) Grab a “text” widget from your available widgets section and drag it into position on your sidebar wherever you want this linked image to appear. Paste the html code copied from your draft post into the text widget window.
- Check your work: Visit your website and check the page to be sure it’s working correctly and that the link is opening in a new browser window.
Ta da! When you’re done, you can either save the draft post to use for another image or delete it. This multi-purpose method can be used to link blog hop badges or advertiser promos to another page without taking the chance of losing your visitors. I actually used it to create my own social media follow links.
Readers, will you use this information to change your links? Leave a comment and let me know if you have another method!
Did you enjoy this article? Subscribe to my blog and you’ll never miss my weekly posts! It’s easy: Just enter your email address in the upper right corner of this page. Just so you know, I will never sell, share, or rent your contact information. That’s a promise!