Search
Other DB Replacer questions
Forum

Removing links in images

Andy Wilson's Avatar Andy Wilson
Hi Peter,

Having moved and renamed lots of Joomla articles and categories, many of the links in the images are broken so I need to remove them all with DB Replace Pro 7.1.1 in Joomla 3.10.5

A sample link is:
<a href="/bible-teaching-videos/2013/3024-the-christmas-story-3-jesus-birth-luke-2-1-20">
Please would you give me the regular expression?

In the "Where" field is it possible to select just one cat id and recursively select all the cat ids under it without having to list them all? If so, what should I enter, please?

Thanks very much,

Andy
Peter van Westen's Avatar Peter van Westen ADMIN
No, you can't do that with the WHERE. That would require complex queries with joins and/or subqueries, which DB Replacer does not support. So you will have to list all the category ids you want to search in.
Please post a rating at the Joomla! Extensions Directory
Andy Wilson's Avatar Andy Wilson
Thanks for putting me straight on the WHERE question.

Please would you give me the regular expression for removing the links?

Andy
Peter van Westen's Avatar Peter van Westen ADMIN
What is the before and after html for the links you want?
I guess you don't want the replacement to be done on all possible links. So please tell me what parts of the url/html are common and which parts are dynamic.
Please post a rating at the Joomla! Extensions Directory
Andy Wilson's Avatar Andy Wilson
Dear Peter,

I would like to remove the COMPLETE link on ALL of the thumbnail images in a category, for instance, visitors to this blog page
https://greenfordbaptist.london/worship-meetings/worship-meetings-2022
would then have to rely on clicking either the Read More button or the header title to see the full article. In the example of the following paragraph, the common starting code would be
<p>
and the ending common code would be
<img src="
so the complete link between these points, i.e.
<a href="/bible-teaching-videos/2022/3970-greenford-baptist-church-sunday-worship-meeting-in-person-live-streamed-2-january-2022">
would be deleted.

AN HTML EXAMPLE OF THE THUMBNAIL IMAGE WITH ITS LINK
<p><a href="/bible-teaching-videos/2022/3970-greenford-baptist-church-sunday-worship-meeting-in-person-live-streamed-2-january-2022"><img src="https://i.ytimg.com/vi/qfmmCR9rvzw/mqdefault.jpg" alt="Greenford Baptist Church Sunday worship meeting (in-person, live-streamed) 2 January 2022" width="295" height="166" title="Greenford Baptist Church Sunday worship meeting (in-person, live-streamed) 2 January 2022" /></a></p>

Thanks,

Andy
Peter van Westen's Avatar Peter van Westen ADMIN
So if I understand correctly, you want to replace all images surrounded with <a> tags, with just the image.
So:
<p><a ...><img ...></a></p>
Should become:
<p><img ...></p>

Regex would be something like:
<p><a [^>]*>(<img [^>]*>)</a></p>
Replace with
<p>\1</p>
Please post a rating at the Joomla! Extensions Directory
Andy Wilson's Avatar Andy Wilson
Dear Peter,

That is awesome, you have saved me so much time. Thank you so much.

Andy
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription