- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
How can I remove a link from an image in the editor?

How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
I know how to make something a hyperlink or change a hyperlink, but I have an image that is linked on my site and as part of a variation I want to remove that link. Thanks!
Solved! Go to Solution.
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Right click on the image, hover over edit element then click on edit hyperlink. Delete the existing link. If you'd like to commit the same change in the variation code section of your experiment simply copy and paste the following line of code:
$("YOURIMAGESELECTOR").attr({"href":""});


Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report


Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report


Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
$("#zone-postscript-wrapper").css({"display":"none", "visibility":""});
$("#region-user-second").css({"display":"none", "visibility":""});
$("#region-footer-first").css({"display":"", "visibility":"hidden"});
$("p > img").removeAttr("src").removeAttr("srcdoc");
$("p > img").css({"display":"none", "visibility":""});
$(".logo-img > a").attr({"href":""});
http://www.studyisland.com/products/home
The logo links back to the homepage and that is the hyperlink I'm trying to remove (along with other elements) for a certain audience. Currently, with this code, the logo no longer sends you to the homepage, but it still is clickable and just reloads the page.
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
$('#logo').find('img').unwrap();



Re: How can I remove a link from an image in the editor?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Remove the <a> entirely using .detach() or .remove().
$(".logo-img > a").remove();
But - since your image is inside the <a>, that will make your logo disappear too.
So what you need to do instead is detach() the image, .remove() the <a> and the put the image back into the right spot:
var logo = jQuery('#logo'); jQuery(logo).detach(); jQuery('.logo-img a').remove(); jQuery(logo).appendTo('.logo-img');
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Or, use .unwrap() as @robertchan suggested (I keep forgetting about this method...)
Re: How can I remove a link from an image in the editor?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
@nap0leon wrote:Or, use .unwrap() as @robertchan suggested (I keep forgetting about this method...)
@JDahlinANF The code you provided did the trick!
What I used:
var logo = jQuery('#logo');
jQuery(logo).detach();
jQuery('.logo-img a').remove();
jQuery(logo).appendTo('.logo-img');
@robertchan Thanks for all the replies! I couldn't quite figure out how to make your method work, but I didn't keep trying once I found that the above worked.
Thanks again to both of you for the help!