kingding
Member
- Aug 17, 2019
- 52
- 22
- 8
In my wordpress posts, some images are clickable and some are not. When they are clicked, they open a new page. I do not want any clicking & url behaviour.
I could go through every single post in the backend, click every image, and disable each media link... but that would take years! My best thought is to do an SQL query to remove any instance of <a></a> from divs with the wp-block-image class.
Essentially...
- IF "<a href="https://wordpress: ... " exists after "<figure class="wp-block-image">", then delete "<a ... >"
- IF "</a>" exists after "<img src="https: //wordpress- ... >", then delete "</a>"
Unless of course you have a better idea than SQL?
I could go through every single post in the backend, click every image, and disable each media link... but that would take years! My best thought is to do an SQL query to remove any instance of <a></a> from divs with the wp-block-image class.
Essentially...
- IF "<a href="https://wordpress: ... " exists after "<figure class="wp-block-image">", then delete "<a ... >"
- IF "</a>" exists after "<img src="https: //wordpress- ... >", then delete "</a>"
Unless of course you have a better idea than SQL?

Attachments
-
Capture 2022-05-12 at [email protected]91.2 KB · Views: 9