I don’t know if this is the best way to do this, but it works for me.
In the functions.php of the theme you are using, put this:
function remove_img_src($html)
{
$html = preg_replace('@(width|height)="([0-9])+" ?@i', '', $html);
return $html;
}
add_filter('image_send_to_editor', 'remove_img_src', 10, 8);
It uses regular expresions to change the output that is inserted in the editor.
Related Posts:
- How do I disable responsive images in WP 4.4?
- WP 4.4. responsive images browser choosing the “wrong” one
- Making WordPress Gallery (.gallery-item) Responsive?
- WP 4.4 aspect ratio with responsive image
- How can I serve different images depending on screen size with wordpress
- How to Make WordPress Default gallery responsive on mobile?
- Responsive background images added inline
- Responsive Images – Add srcset attributes to custom Images Function
- Get a list of all image sizes that match aspect ratio of original one
- How to exclude an image size from the WordPress srcset
- Responsive Images Resizing Images
- Featured image (responsive) above content is too small after update to WordPress 4.4
- How to display a different image size for mobile
- WP Responsive images – upload custom image sizes
- Fuzzy Images in WordPress 4.4
- Removing height and width from images with a caption
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Multiple amp-image overlays. How to properly do this in wordpress?
- Fallback for missing srcset images
- max_srcset_image_width doesn’t work as intended
- Using SRCSET with Images and Featured Images
- Understanding WordPress image sizes and responsive images
- Custom responsive ‘featured image’ sizes
- One of my image sizes isn’t showing up in srcset
- How to stop WordPress from completely overriding my tags in my templates?
- Adding srcset to an image in ajax
- the_content not showing responsive image attributes srcset or sizes
- Serve different images per screen size and cache possible?
- Disable Media File Image Link On Mobile Devices
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Why does WordPress list all image sizes in srcset even if they’re larger?
- Responsive header image
- What’s are some best practices for responsive images (e.g. for section headers)?
- WordPress Responsive Image ( srcset ) not work properly
- Responsive Images – Defining
- Decide how Hero image appears on mobile
- Responsive Featured Images Not Working
- Responsive images with srcset
- Getting extra image links in code with wp_get_attachment_image
- built-in responsive images in content – do I need to add anything to functions.php?
- Responsive images in Bootstrap 4 slider
- WordPress not choosing the right image from srcset
- Responsive Images in WordPress
- Is there a good way to use CMS images with CSS
- Remove one srcset entry from wp_get_attachment_image
- Generate / attach Image srcsets from ACF Image Field
- Set default image sizes in WordPress to hard crop
- How to modify image editor dialog options on WordPress?
- Apply image width to tag
- How to use the responsive images feature from WP 4.4 in your themes
- Excludes posts that don’t have attachments in the_content()
- Remove duplicate images from media library.
- Why would image paths in wordpress suddenly change?
- Show prev and next post links for parent post of current image in attachment page?
- wordpress responsive image srcset not working
- could not upload image in media library
- Check if page/post has any anchors that link to an image jpg/gif/png
- How to check if user is uploading/setting an image as a featured image?
- Trying to create a mouseover effect in html using Gutenberg editor
- How to output images as figure/figcaption
- wordpress get gallery images title
- How to fix “.webp” being auto-added to the end of image urls
- having issue while uploading An error occured in the upload. Please try again later
- How to change image atributes right before an image to be saved?
- Is it possible to put images as url in document [closed]
- Creating ‘required’ fields in the ‘add media’ window
- Time Based change of image
- how to get image full path from WP_Post Object?
- Featured Image problem with resizing
- Not seeing text alignment option in Image block
- wp_get_attachment_url images in wrong order [closed]
- Migrated site – Images have 404 error
- Show (print) featured image all dimensions (height, width)
- Speed Up Website With High Resolution Images
- How come the images arent loading properly?
- How to use the thumbnail size with catch_that_image
- Not able to retrieve image id from sibling site within a switch_to_blog
- How to display a warning when an uploaded image is too small?
- How to link image in WordPress – Elementor when certain element does not offer that option?
- Large uploaded images not resizing?
- How to generate alt attributes with php / filters?
- Convert multiple image blocks to gallery block in Gutenberg?
- WordPress After migration some images src is empty
- How to get featured image of last post in a category?
- How can I add “alt” tag to element?
- Recovered WordPress installation (on localhost) links broken and images not showing
- Media sizes do not appear
- How to make Facebook share the featuterd image from url on WordPress
- Changing current post image uls with a function
- How to watermark wordpress images from wp-content/uploads folder with htaccess and php?
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Images not rendering
- Retrieving Image Storage path
- how to display all images from their siblings/ from same parent?
- Specify what to do for a specific image number of the post
- adding images to wordpress pagination?
- How do you change all images dimensions to have the same size?
- Delete all thumbnails & regenerate them?
- Gutenberg block HTML image rendering override