You can try this way
function filter_ptags_on_images($content) {
$content = str_replace( "><p></p>", "", $content );
}
add_filter('the_content', 'filter_ptags_on_images');
Let it give a try
Related Posts:
- How can you limit srcset on a single type of page?
- Images with overlay
- Missing feature image link function
- How do I change/modify the_post_thumbnail(); html output?
- How to change the markup WordPress inserts for post images
- Programmatically Set First Image as Featured
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- WP 4.4. responsive loads normal image after loading the responsive image
- How to add classes to images based on their categories?
- How to reduce original image quality on upload?
- Is it possible to maintain image aspect ratio when scaling images?
- Set image size on media and text block with a function
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Generating Responsive Background Image Sizes in PHP
- Create thumbnail on PDF upload with Gravity Forms
- Remove images from get_the_excerpt
- Use Exact Image Size using add_image_size
- How to add a rel attribute to images that contains their categories?
- Pinterest Integration Using functions.php
- radio button is checked but display not check
- Display height and width properties with the_post_thumbnail() or related function
- Insert width & height attributes to all images displayed on each page
- Custom image size in Media Dropdown
- Removing the first image in content
- Function to auto-set a featured image that is already in use
- Actions according to image type and size
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- Overwrite Parent Theme add_image_size in Child Theme
- Images uploaded using media uploader are appearing upside down
- How to add css class to image attached in all the posts?
- Add custom image size not working
- how to add an image to the footer?
- wp_get_attachment_image function size argument not working if I also add a custom class
- Inserting HTML tag with ACF into shortcode
- Understanding and altering the structure of posted images
- Publish/Update post is changing image links from file url to post url
- Featured Image Thumbnail Creation
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Display images that are not in the content
- WordPress Menuing Question :focus
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- show first 3 thumbnails of posts in different sizes [closed]
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Can’t generate thumbnail images
- PHP mixed with some JS code to update WordPress theme settings
- Add a unique class to HTML tag/element
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- Limit dimensions of “Full” size images
- How to hide image-url if no attachment?
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- How to properly set custom logo size?
- The correct way to add a JavaScript in the functions.php [closed]
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- How to Add Shortcode to html img code?
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- How to add a new image size and apply it to posts only?
- Image Crop Not Working
- Use existing image sizes for WooCommerce
- Problem in using Customizer
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- Retrieve First Image Function
- Custom Image Size in Insert Media
- Featured Image keeps cropping
- Prevent creating multiple image resizes in twentytwelve template
- Shortcode of a function
- Conditional function for excluding first image from content, not working
- get_image_tag() html output : empty src attribute
- Need To Resize Images Exactly Without Losing Image Details
- how can I change all wordpress media file url to custom cdn url?
- Different image using srcset function
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- Auto delete content in specific folder inside media library
- How to use data URL in WordPress?
- How to update an image attachment’s alt text from a custom field when saving a post?
- how to check if an element in an html file exists in another html file? [closed]
- large image size of 1440×1440 not pulling 2x of 2880×2880 image
- Can You Set A Minimum Image Dimension For Resizing Images?
- blank page with wp_get_attachment
- How do I make a custom “Read More Blogs” button for my blog page
- (Divi): How to make WordPress load images of specific size for Blurb modules on given page with a funciton?
- Add schema to Search result page’s body. Tried using is_search
- Featured image on archive page based on post type
- restrict uploaded image size and fixed image display size
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Disable links to images only if link is an image
- Restricted images only for logged user. (hidden url)
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Different body image backgrounds on different pages, posts and categories
- Update add_image_size
- Sanitize html, where to sanitize
- Remove heading tags on line break
- Open image size links in a page instead of direct image link
- Full size image option removing problem
- Function to get thumbnail img source
- How to resize image from import image url?
- How to crop image in WordPress with aspect ratio for any size of image
- How to add height and width dimensions automatically to archive descriptions
- Can’t find function which is called in a wordpress theme
- How to overwrite image if it already exists – WordPress, Gravity form