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
- Remove srcset thumbnail attribute for products in the WooCommerce shopping cart
- wp_get_attachment_image with custom size not rendering possible 2x srcset image
- medium_large image size not displaying properly on the frontend?
- remove or update add_image_size
- Why is wp_get_attachment_image_src returning wrong dimensions? [duplicate]
- Can WordPress resize BMP files?
- How to include externally hosted images into a gallery block
- Drag images with caption in WP editor
- Any way to “combine” galleries or show multiple galleries as one?
- How to remove buttons from gutenberg toolbar
- Get full image array
- Display number of images actually posted
- media_sideload_image with rewritten urls?
- SVG Featured image not shown in twitter
- upload featured image in custom post type from frontend
- WooCommerce-like featured gallery
- How to use photo in multiple posts?
- Creating a thumbnail from an image already on the server?
- Alter the image, before save, of a particular image size
- Hero image cropped at different dimensions
- How to handle a background-size: cover image in WordPress?
- Empty alt/title form check in media library
- How To Get The File Extension Of Images Having Different Extensions In A Directory?
- Gallery with thumbnail carousel
- Uploaded images not displaying in network site
- Omit image captions from get_the_content()
- How to limit the number of images displayed in the media window?
- Is it possible to preserve original images in order to change image size later?
- Need custom picture field for pages
- Only make custom image size if uploaded via Thickbox and attached to certain page
- How to add onclick event to widget image
- Use default image as var
- How to apply image alt descriptions from media library?
- Specify automatically the height and weight of the images
- How to crop images in a certain size only for a certain page?
- Specific Days, Specific image on Front Page
- How to change image’s author via a function when using GravityForms uploader? [closed]
- Using different size thumbnails on different parts of my site… with functions.php?
- Serving Images from subdomain in wordpress
- Hover a css icon width other color inside wp_get_attachment_image
- Can’t upload Images to WordPress – Error 500 Response
- How to skip the creation of landscape thumbnails for an original portrait image
- Why are my button images blurry on mobile screens?
- How to show only one image in homepage
- Broken imges after moving wordpress website from localhost to server [closed]
- click on Gallery picture but pictures doesn’t appear
- How to Generate Custom Image Size in Uploads Folder?
- Select image and display from textfield?
- Upload button in metabox not working
- (Dynamically) Decrease the actual image size for downloads
- wordpress images not display [closed]
- Get content from one WordPress website to another
- How to get WordPress to resize images for srcset?
- Edit multiple posts featured image