Bulk edit Gutenberg single images to change from linking to media file to attachment page
Fastest way in my opinion would be to apply filter on the_content with preg_replace_callback to find media URLs and replace them with anything else, like attachment pages. Attachment ID is available as part of <img> class value as well as wp:image attribute in Gutenberg comment. So you just need some smart regexp to match each … Read more