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 image block in content and replace it. No undo needed. However this is maybe not the best solution performance wise, as replacents will be done on each page request (unless caching is used).
Better solution would be to run some PHP code once (wp-cli command or otherwise) to loop over all posts and replace post_content value with replaced URLs. Save DB backup before this for undo or create reverse replacement function as well.
Related Posts:
- How to extend the gallery block in Gutenberg?
- Set default image link target in Gutenberg image block
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- get_post_gallery with Gutenberg
- How to include externally hosted images into a gallery block
- Apply image width to tag
- How to link Gutenberg Gallery images To Media file automatically?
- How to Add extra option to Image Block Settings?
- @wordpress/create-block image url in css
- How to remove buttons from gutenberg toolbar
- Extend core block attributes in post content
- Gutenberg editor get post featured image by id
- hardcrop images in gutenberg “latest posts” block
- Trying to create a mouseover effect in html using Gutenberg editor
- Prevent Image Pasting in RichText Component
- Multiple amp-image overlays. How to properly do this in wordpress?
- Update an image block style programatically
- Add width & height attributes to Gutenberg’s image output?
- update_post_meta attachment_image_alt description for Gutenberg
- Bulk-add featured images in posts with no featured image
- How to get the Gallery form/section just like in Gutenberg block?
- Is there a wordpress filter to edit the markup of inline images?
- How to upload and style svg logo?
- Weird failing request
- How can I check if the first block is an image aligned left or right?
- Not seeing text alignment option in Image block
- Doing a bulk replace of images through back-end
- Place image caption outside of figure tag (Gutenburg Image Markup)
- Change Image Size option in the settings in bulk
- How to disable a WP Image Block to link to itself?
- get_post_gallery with Gutenberg
- How to join Caption AND Description Meta Fields as one combined-caption in Image Block
- Using srcsets in a custom block
- Rebuilding core image block
- A query to substitute images paths in gutenberg (website migration)?
- Convert multiple image blocks to gallery block in Gutenberg?
- get_post_gallery with Gutenberg
- Custom filename when pasting an image from clipboard
- Multisite image URLs incorrect in editor
- Gutenberg block HTML image rendering override
- Edit multiple posts featured image
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Define how an attached image is rendered
- Adding or replacing image size
- [Solved]: Extend the list view in gutenberg editor?
- Restricting users to view only media library items they have uploaded?
- Add image size where largest possible proportional size is generated
- Rename files on upload
- What are people using for displaying Image / Media copyright information?
- WP 4.4 aspect ratio with responsive image
- Circumventing the normal image upload process
- How to get current image’s slug in WP_image_editor?
- Add CSS class to every image
- add data-attribute to all images inside the_content()
- Regex to turn embedded images in to attachments
- Removing Title Tag from Thumbnails
- When Uploading JPEGs, Does WordPress Compress the Original Image?
- Regenerate missing _wp_attachment_metadata
- Editing built in Gallery shortcode to filter by categories
- Image with description side by side
- How can i use wp_get_image_editor for image resizing
- Gallery images stored elsewhere (preferably Google Drive)
- WordPress gallery previous/next buttons showing all media library images
- Modifying protexted image sizes: use “add_image_size()” or “update_option()”?
- attach unattached featured images to respective posts
- Pull Random Attachments With Pagination
- Upload media files to Amazon S3
- How to get default image sizes attribute
- Image not shown in the theme as it’s showing in HTML template [closed]
- Broken Images until Page Refresh
- Get image from parent category
- Images attached to posts from library link to 404 error page
- Stop WordPress from cropping images using url parameters
- Add clickable link on an image
- How do you import images from a URL in your post?
- How do I get a smaller size of an avatar image
- When the new post which has no image published, save the specific image as the featured image ( by category )
- download link for uploaded images for wordpress
- How do I link a featured photo to it’s post?
- How to get the title of the random images from media library?
- How to indent pictures on WordPress blog? [closed]
- Image and shortcode not showing in excerpt
- What is the plugin to import image from URL?
- How to enlarge thumbnail on mouseover?
- User uploads image as “Featured Image” but WordPress resizes it?
- Hide Title tag on image Hover
- How to get the best resolution of image from srcset
- Images do not show in the website, but they appear on new tab
- featured image in custom poste type (backend)
- Image Uploader Doesn’t Open Modal in Widget
- Image linking and lightbox
- Uploaded images appear broken in WP 4.4
- Get attachment images does not return any attached images
- Add two images with Sweet Testimonials
- Breadcrumbs for Single Image page
- WordPress Images | How to get the cropped image?
- Import existing image as a single post
- Media Library is not loading on grid view in admin panel
- How can I put pictures next to each other and how can I add a location? [closed]
- Media upload error